Skip to content
/ CCPD Public
forked from detectRecog/CCPD

[ECCV 2018] CCPD: a diverse and well-annotated dataset for license plate detection and recognition

License

Notifications You must be signed in to change notification settings

hujunyao/CCPD

Repository files navigation

CCPD

Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline

CCPD: Chinese City Parking Dataset

Attention: there are some errors in dataloader and this is why training goes wrong. These two days I will correct these errors and uploaded a refined dataset && a test code && a well trained rpnet model.

This repository is designed to provide an open-source dataset for license plate detection and recognition, described in 《Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline》.

The google drive link for directly downloading the whole dataset: google drive 12GB.

The baiduyun link for directly downloading the whole dataset: baiduyun 12GB.

The nearly well-trained model for testing and fun (Short of time, trained only for 5 epochs, but enough for testing):

This dataset is open-source under MIT license. Files under this git repo are sample images. More details about this dataset are avialable at ECCV 2018 paper 《Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline》. If you are benefited from this paper, please cite our paper as follows:

@inproceedings{xu2018towards,
  title={Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline},
  author={Xu, Zhenbo and Yang, Wei and Meng, Ajin and Lu, Nanxue and Huang, Huan},
  booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
  pages={255--271},
  year={2018}
}

Specification of the categorise above:

  • sample: gives 6 example pictures for each sub-dataset(blur/challenge/db/fn/np/rotate/tilt).

  • rpnet: The training code for a license plate localization network and an end-to-end network which can detect the license plate bounding box and recognize the corresponding license plate number in a single forward.

Annotations

Annotations are embedded in file name.

A sample image name is "025-95_113-154&383_386&473-386&473_177&454_154&383_363&402-0_0_22_27_27_33_16-37-15.jpg". Each name can be splited into seven fields. Those fields are explained as follows.

  • Area: Area ratio of license plate area to the entire picture area.

  • Tilt degree: Horizontal tilt degree and vertical tilt degree.

  • Bounding box coordinates: The coordinates of the left-up and the right-bottom vertices.

  • Four vertices locations: The exact (x, y) coordinates of the four vertices of LP in the whole image. These coordinates start from the right-bottom vertex.

  • License plate number: Each image in CCPD has only one LP. Each LP number is comprised of a Chinese character, a letter, and five letters or numbers.

  • Brightness: The brightness of the license plate region.

  • Blurriness: The Blurriness of the license plate region.

Training instructions

Input parameters are well commented in python codes(python2/3 are both ok, the version of pytorch should be >= 0.3). You can increase the batchSize as long as enough GPU memory is available.

Enviorment (not so important as long as you can run the code):

  • python: pytorch(0.3.1), numpy(1.14.3), cv2(2.4.9.1).
  • system: Cuda(release 9.1, V9.1.85)

For convinence, we provide a trained wR2 model and a trained rpnet model, you can download them from google drive or baiduyun.

First train the localization network (we provide one as before, you can download it from google drive or baiduyun) defined in wR2.py as follows:


  python wR2.py -i [IMG FOLDERS] -b 4

After wR2 finetunes, we train the RPnet (we provide one as before, you can download it from google drive or baiduyun) defined in rpnet.py. Please specify the variable wR2Path (the path of the well-trained wR2 model) in rpnet.py.


  python rpnet.py -i [TRAIN IMG FOLDERS] -b 4 -se 0 -f [MODEL SAVE FOLDER] -t [TEST IMG FOLDERS]

Test demo instructions

After fine-tuning RPnet, you need to uncompress a zip folder and select it as the test directory. The argument after -s is a folder for storing failure cases. File rpnetEval.py is for testing thousands of images in the test directory and print precision. File rpnetTestSeveralImages.py is for evaluating several images in a folder and plot the results on images.


  python rpnetEval.py -m [MODEL PATH, like /**/fh02.pth] -i [TEST DIR] -s [FAILURE SAVE DIR]

Acknowledgement

If you have any problems about CCPD, please contact [email protected].

Please cite the paper 《Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline》, if you benefit from this dataset.

About

[ECCV 2018] CCPD: a diverse and well-annotated dataset for license plate detection and recognition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%