Korean cars licence plate detection and recognition using Keras.
Licence plate detection and Recognition is made by using Keras framework. You may find 3 folders that consist of separate implementation of
- Detection part using Yolov3,
- Recognition part implemented with CRNN
- Program that combines both techniques
In addition, you can find synthetic Data generator that creates Plates, immitated CCTV and Parking images
I used ideas from other github accounts, combined them to solve Licence Plate Detection and Recognition Problem.
- YoloV3 (https://github.com/experiencor/keras-yolo3)
- CRNN (https://github.com/qjadud1994/CRNN-Keras) - Thank you for your help!
- YoloV3 finds 2 points that indicate plate location in the picture
- We pass an array of cropped plate to Recognition model
- CRNN finds label to the given image
I have attached YoloV3 and CRNN papers to this repository. I suggest you to read them before you start
CRNN requires a lot of training data. For that reason I made a plate generator and using it created 500k plate images. Train my model on synthetic data first and applied fine-tunning techniques with real data.
Detection of Parking and CCTV images are different tasks, since you are dealing with different scales. I trained them separately.
- Prepare data. Create images folder and folder with annotations (PASCAL format)
- Compute anchors.
python gen_anchors.py -c config.json
- Write data path, anchors to config.json file
- Train
python train.py -c config.json
- Evaluate
python evaluate.py -c config.json
CRNN requires a lot of training data. For that reason I made a plate generator and using it created 500k plate images. Train my model on synthetic data first and applied fine-tunning techniques with real data. So generaly speaking, I made pretrained model and on top of that trained with real images.
CCTV and Parking data was trained separately.
File | Description |
---|---|
Model .py | Network using CNN (VGG) + Bidirectional LSTM |
Model_GRU. py | Network using CNN (VGG) + Bidirectional GRU |
Image_Generator. py | Image batch generator for training |
parameter. py | Parameters used in CRNN |
training. py | CRNN training |
Prediction. py | CRNN prediction |
Provieed techniques work fine. But here are some things to note:
- YoloV3 doesn't like small objects. So, CCTV detection accuracy was relatively bad in comparison with Parking. My suggestion is while working with CCTV, detect car first and than run plate detection
- Models don't really like synthetic data. So don't overfit your model with generated data, but remember about real test data.
Hope this guide will be helpful. Have fun!