sid0312 / ANPR

License Plate detection and recognition on Indian Number Plates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic Number Plate Recognition (ANPR)

License Plate detection and recognition on Indian Number Plates using Yolo v3 Darknet and Pytesseract

Detection

Dataset Preparation

This would serve as our starter dataset

  • Check out JSON preprocessing to yield the dataset in yolo format here

  • I have uploaded the prepared dataset too

Clone the darknet repository

git clone https://github.com/pjreddie/darknet
cd darknet
  • We add our processed data to the data folder in the darknet directory

  • After cloning the darknet repository, we run split.py to segregate the data into training and validation image paths https://github.com/sid0312/ANPR/blob/master/split.py in darknet/data/train.txt and darknet/data/val.txt repectively

Let us train now !!!

The entire training process has been explained here

We train on YOLO v3 Darknet in Google Colaboratory. Notice the darknet forlder in the repository shows the files to be added to the cloned repository from Pjreddie.

Model checkpoints

Time for detection

git clone https://github.com/sid0312/ANPR
cd ANPR
python test.py -i /path/to/image -c /path/to/config_file -w /path/to/weights/ -cl /path/to/obj.names

Results for detection

Note: It works on only high resolution images as the dataset contains only 237 images. A larger manually labelled dataset would lead much robust predictions

We obtain a cropped region of interest too

Recgonition

Now we use Optical Character Recognition on the cropped Region of Interest to obtain the value of the license plate. We use the awesome Pytesseract library

cd ANPR
python recognition.py /path/to/cropped/img

Recognition results

Our ANPR works. Credits to....

Just Kidding 😂 😂 !!!

Made with ❤️ by Siddhant Baldota

About

License Plate detection and recognition on Indian Number Plates


Languages

Language:Jupyter Notebook 99.2%Language:Python 0.4%Language:Makefile 0.4%