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.
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
Run the following shell script to download the network.
$ bash get-networks.sh
You can use folloeing commands or can use this Googlecolab notebook for samples.
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
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
Use webcam.sh script to run ALPR on webcam.
Example
$ bash webcam.sh
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