Skip to content

Tkvmaster/ANPR-System

Repository files navigation

ANPR System

Automatic number plate detection system using Deep Learning and Computer Vision concepts in order to detect license numbers of vehicles in real-time video streams.

Python contributions welcome LinkedIn

😇 Overview

Automatic number-plate recognition (ANPR) is a technology that uses optical character recognition on images to read vehicle registration plates to create vehicle location data. It may be used in a variety of public settings to serve a variety of functions, including automatic toll tax collection, car park systems, and automatic vehicle parking systems.

This project uses YOLOv5 for number plate detection and paddleocr for recognizing characters of the detected number plate. It also uses object tracking to track number plates and get the best OCR result for each plate, which is then saved into a CSV file.

🔧 TechStack/framework used

📃 Proposed system

To solve this problem, I've taken a two-step approach. In the first step is number plate detection model is trained using YOLOv5 model.

The second step is to run the number plate detection model to locate all of the number plate present in an image and extract plate region from that image. Once a number plate is located, preprocessing is performed on ROI image and PaddleOCR is used to recognise characters in the number plate.

When running above proposed ANPR on a video, it causes some issues which makes the ANPR less accurate, such as Jittering, Fluctuation of OCR output. But if the tracker is used, these issues can be rectified. The NorFai Tracker will be used to track the number plate and ensure the best OCR results are obtained. The recognized number plates will be saved to a CSV file.

📁 Dataset

The dataset consists of 928 images different types of vehicles. These images are collected from:

🔑 Prerequisites

All the dependencies and required libraries are included in the file requirements.txt See here

Make sure to install correct gpu versions of PaddlePaddle and torch.

🚀  Installation

  1. Clone the repo
$ git clone https://github.com/Tkvmaster/ANPR-System.git
  1. Change your directory to the cloned repo
$ cd ANPR-System
  1. clone the YOLOv5 directory from GitHub
$ git clone https://github.com/rkuo2000/yolov5/
  1. Now, run the following command in your Terminal/Command Prompt to install the libraries required
$ pip3 install -r requirements.txt

💡 Working

To detect number plates in video feed:

$ python3 anpr-system.py \
    --weights yolo_weights.pt \
    --input input_video.mp4 \
    --output output_video.mp4 \
    --csv all_number_plates.csv

🔑 Results

Alt Text

Video Source : https://www.videvo.net/video/cars-driving-along-an-indian-freeway/6374/

⚠️ Limitations

This ANPR system is designed for real-time license plate detection and recognition, but it may not work well in all situations. The accuracy of the system may be affected by factors such as lighting, camera quality, and the angle and position of the license plate in the video.

👀 Licensing

The code in this project is licensed under MIT License.

Releases

No releases published

Packages

No packages published