ramcho3855 / alpr-for-indian-vehicles

Automatic license plate recognition for indian number plates based on YOLO
Other
0 stars 0 forks source link

ALPR(Automatic License Plate Recognition) For Indian vehicles

Introduction

This repository can be used to detect the registration number of Indian vehicles in robust scenarios. It uses YOLOv2 for vehicle detection, FAST-YOLOv2 for license plate detection and a CNN for character recognition.

Requirements

This project uses AlexyAB's darknet framework. The Darknet framework is self-contained in the "darknet" folder and must be compiled before running the tests. To build Darknet just type "make" in "darknet" folder:

$ cd darknet && make

if you wish to use GPU you can use Makefile in GPU folder inside the darknet folder or you can make necessary changes in Makefile.

This code was tested in an Ubuntu 18.04.4 LTS machine with Python 3.6.9 and Opencv 3.4.9

Download models

Run the following shell script to download the network.

$ bash get-networks.sh

Examples

You can use folloeing commands or can use this Googlecolab notebook for samples.

Running on images

Use script run.sh to run ALPR on images. It requires 3 arguments:

Example

$ bash run.sh -i  samples/input -o  samples/output -c samples/output/result.csv

Running on Video

Use script video.sh to run ALPR on videos. It requires 3 arguments:

Example

bash video.sh  -i samples/video/test.mp4 -o samples/output -c samples/output/result.csv

Runnig on webcam

Use webcam.sh script to run ALPR on webcam.

Example

$ bash webcam.sh

Using OpenCV with multiple threads

Use mthread.py script to run ALPR using OpenCV. It will use OpenCV's dnn module. It require one argument if you wish to process video file other no argument to use webcam.

For video

$ python mthread.py --video samples/video/test.mp4

For webcam

$ python mthread.py

Results

Exmaple result

References

  1. https://github.com/sergiomsilva/alpr-unconstrained
  2. https://github.com/AlexeyAB/darknet