This is the official implementation for "Style Reconstruction-Driven Networks for Occlusion-aware License Plate Recognition" Paper.
- Clone this repository.
- Install the required packages by running:
pip install -r requirements.txt
- Note: We provide the training code for the CCPD dataset. You can modify the code to train on other datasets.
- You can train the model with
CCPD_lite
which is a lite version of the CCPD dataset. The lite version contains 100 images for training and 50 images for validation. You can train the model by running thetrain.py
script after modifying theconfigs/train_config.yaml
file to set the correct paths for the dataset. - To train the model on the full CCPD dataset, you need to follow these steps:
- Download the dataset and put it in the
data
folder. - Run the
tools/crop_ccpd.py
script to crop the license plates from the CCPD dataset. We will use the cropped license plates for training. Other datasets can be processed in a similar way. - Run the
tools/generator/generate_opencv_syn.py
script to generate synthetic images using OpenCV. We will use the generated images for training. - Modify the
configs/train_config.yaml
file to set the correct paths for the dataset. - Run the following command to train the model:
python train.py
- (optional) You can use
wandb
to log the training process. You need to set thewandb
key in theconfigs/train_config.yaml
file to enable logging. Or you can use the following command to run the training withwandb
:
python train.py wandb.enabled=True wandb.project=project_name wandb.name=run_name
- You can use the trained model to recognize license plates by running the
test.py
script. - We provide a pre-trained model that you can use to recognize license plates.
weight/best_valacc_0.9940.pth
is the pre-trained model.
- You can evaluate the model by running the
evaluate.py
script.
Due to the privacy issues, we cannot provide the CBLP dataset publicly. However, you can send an email to Dr.Zhang ([email protected]) to request the dataset. We will provide the dataset for research purposes only. You should not use the dataset for commercial purposes.
If you find this work useful for your research, please cite our paper:
@ARTICLE{10579856,
author={Liu, Weijia and Zhang, Shaoming and Tang, Yan and Wang, Zhong and Wang, Jianmei},
journal={IEEE Transactions on Circuits and Systems for Video Technology},
title={Style Reconstruction-Driven Networks for Occlusion-Aware License Plate Recognition},
year={2024},
volume={34},
number={11},
pages={11438-11450},
keywords={License plate recognition;Image segmentation;Accuracy;Image reconstruction;Character recognition;Standards;Data models;License plate recognition;style transfer;image generation},
doi={10.1109/TCSVT.2024.3421559}}
- The code for generating synthetic license plates is based on the chinese_license_plate_generator. We would like to thank the authors for their great work.
- The code for augmenting the dataset is based on the PaddleOCR. We would like to thank the authors for their great work.
If you have any ideas or suggestions, feel free to submit them through Github issues or propose pull requests directly to us. We are looking forward to your contributions!