Giter VIP home page Giter VIP logo

license_plate_detection_pytorch's Introduction

License_Plate_Detection_Pytorch

This is a two stage lightweight and robust license plate recognition in MTCNN and LPRNet using Pytorch. MTCNN is a very well-known real-time detection model primarily designed for human face recognition. It is modified for license plate detection. LPRNet, another real-time end-to-end DNN, is utilized for the subsquent recognition. This network is attributed by its superior performance with low computational cost without preliminary character segmentation. The Spatial Transformer Layer is embeded in this work to allow a better characteristics for recognition. The recognition accuracy is up to 99% on CCPD base dataset with ~ 80 ms/image on Nivida Quadro P4000. Here is the illustration of the proposed pipeline:

MTCNN

The modified MTCNN structure is presented as below. Only proposal net (Pnet) and output net (Onet) are used in this work since it is found that skipping Rnet will not hurt the accuracy in this case. The Onet accepts 24(height) x 94(width) BGR image which is consistent with input for LPRNet.

LPRNet Performance

LPRNet coding is heavily followed by sirius-ai's repo. One exception is that the spatial transformer layer is inserted to increase the accuracy reported on CCPD database as below:

Base(45k) DB FN Rotate Tilt Weather Challenge
accuracy % 99.1 96.3 97.3 95.1 96.4 97.1 83.2

Training on MTCNN

  • Download the CCPD data and put it into 'ccpd' folder

  • run 'MTCNN/data_set/preprocess.py' to split training data and validation data and put in "ccpd_train" and "ccpd_val" folders respectively. python3 MTCNN/data_set/preprocess.py -image /home/zwzj/Downloads/CCPD2019/ccpd_base -dir_train ccpd/ccpd_train -dir_val ccpd/ccpd_val

  • run 'MTCNN/data_preprocessing/gen_Pnet_val_data.py', 'MTCNN/data_preprocessing/gen_Onet_val_data.py','MTCNN/data_preprocessing/assemble_Pnet_val_imglist.py', 'MTCNN/data_preprocessing/assemble_Onet_val_imglist.py' for training data preparation (validation data part). cd MTCNN/data_preprocessing python3 gen_Pnet_val_data.py python3 assemble_Pnet_val_imglist.py python3 gen_Pnet_train_data.py python3 assemble_Pnet_train_imglist.py cd ../..

  • run 'MTCNN/data_preprocessing/gen_Pnet_train_data.py', 'MTCNN/data_preprocessing/gen_Onet_train_data.py','MTCNN/data_preprocessing/assemble_Pnet_train_imglist.py', 'MTCNN/data_preprocessing/assemble_Onet_train_imglist.py' for training data preparation (train data part).

  • run 'MTCNN/train/Train_Pnet.py' and 'MTCNN/train/Train_Onet.py cd MTCNN/train python3 Train_Pnet.py cd ../..

cd MTCNN/data_preprocessing python3 gen_Onet_val_data.py python3 assemble_Onet_val_imglist.py python3 gen_Onet_train_data.py python3 assemble_Onet_train_imglist.py cd ../..

cd MTCNN/train python3 Train_Onet.py cd ../..

mv MTCNN/train/pnet_Weights MTCNN/weights/ mv MTCNN/train/onet_Weights MTCNN/weights/

cd MTCNN python3 MTCNN.py --test_image ../test/5.jpg cd ..

Training on LPRNet

  • run 'LPRNet/data/preprocess.py' to prepare the dataset cd LPRNet/data python3 preprocess.py -image /home/zwzj/Downloads/CCPD2019/ccpd_base cd ../..

  • run 'LPRNet/LPRNet_Train.py' for training python3 LPRNet_Train.py --batch_size 64

Test

  • run 'MTCNN/MTCNN.py' for license plate detection
  • run 'LPRNet/LPRNet_Test.py' for license plate recognition
  • run 'main.py' for both

Reference

Please give me a star if it is helpful for your research

license_plate_detection_pytorch's People

Contributors

xuexingyu24 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.