Giter Club home page Giter Club logo

license-plate-recognition-1's Introduction

License-Plate-Recognition

  1. License plate detection using YOLOv4 trained on custom data.
    mAP :- 88.25%(IoU threshold = 50%)
    avg IoU :- 62.87%(conf_threshold = 0.25)
    avg fps :- 16
  2. License plate text detection and recognition using keras-ocr.
  3. Rejecting false positives by matching pattern with Indian license plates.

Requirements:

   absl-py==0.9.0
   easydict==1.9
   keras_ocr==0.8.3
   opencv-python==4.2.0.34
   tensorflow==2.2.0

Demo:

  Download pretrained model from here and copy it inside "data" folder.

 #Run demo on sample video with default arguments
 python demo_video.py
 
 #Run demo with command line arguments 
python demo_video.py --input "Input_video_path" --output "Path_to_save_result" --size "frame_size" #Example python demo_video.py --input inputs/demo1.mp4 --output results/output1.avi --size 608
#Run demo on sample image with default arguments
python demo.py

#Run demo with command line arguments
python demo_video.py --input "Input_image_path" --output "Path_to_save_result" --size "frame_size"

#Example
python demo.py --input inputs/1.jpg --output results/output1.jpg --size 608 

#Note -

  1. Command line argument 'size' must be a multiple of 32. Increasing 'size' increases the accuracy of license plate detection but requires more memory. Reduce the size if your gpu runs out of memory.
  2. If the gpu-ram is 4 GB or less, Reduce memory-limit in this line to a value less than your gpu-ram.
  3. If the gpu-ram is 2 GB or less, Reduce memory-limit here and here to a value less than your gpu-ram.
  4. Since there are 3 models running in a sequence(yolov4 for license plate detection, keras-ocr CRAFT text detection and keras-ocr CRNN text recognition), memory usage is high and fps is low. This solution gives an average fps of 2.5 on gtx 1660 gpu. Fps and memory usage can be improved by training a single YOLOv4 model for both license plate detection and text recognition.

Results:

results/output1.jpg results/output2.jpg results/output3.jpg results/output4.jpg results/output1.gif results/output2.gif

How to train:

  1. Download dataset zip from this link - https://www.kaggle.com/tustunkok/license-plate-detection/data
  2. Create a folder named 'dataset' inside 'data' and extract the content of zip into 'dataset' folder.
  3. Go to 'data' folder and run this command on cmd - "python augmentation.py". After augmentation total number of images will be 2154.
  4. Now to train darknet YOLOv4 on the dataset, follow the steps given here - https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects

References

  1. https://www.kaggle.com/tustunkok/license-plate-detection/data
  2. https://github.com/AlexeyAB/darknet
  3. https://github.com/hunglc007/tensorflow-yolov4-tflite
  4. http://openaccess.thecvf.com/content_ICCVW_2019/papers/RLQ/Nguyen_State-of-the-Art_in_Action_Unconstrained_Text_Detection_ICCVW_2019_paper.pdf
  5. https://pypi.org/project/keras-ocr/
  6. http://www.rto.org.in/vehicle-registration-plates-of-india/format-of-number-plates.htm

license-plate-recognition-1's People

Contributors

keshavoct98 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.