Generates artificial vehicle license plate following the Brazilian traffic department design patterns.
- Random plate Generator
- Annotated characters
- Data Augmentation
- Balanced character dataset
- TensorFlow TFRecord generator
Letters: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X, Y, W, Z
Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Special: -
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Linux system: Ubuntu 16.04 (Xenial) or later
- python 3.5.2
- pip
- pillow
- matplotlib
- imgaug
- opencv
Clone source code from git repo
$ git clone https://github.com/fernandorovai/BRLicensePlateGen
Install python dependencies via pip
$ pip install -r requirements.txt
$ cd BRLicensePlateGen
$ python plateGenerator.py 6 (generate 6 random plates)
- Augmentation is performed automatically in every generated plate.
----------------------------------------------------------
For external data usage, instantiate the class as follows:
from plateGenerator import plateGenerator
plateGen = PlateGenerator()
plates = plateGen.generatePlates(numOfPlates=numOfPlates)
- Plates dict structure
plates = {
"plateIdx": idx,
"plateImg": finalImg,
"plateBoxes": [(xMin, yMin, xMax, yMax, tagValue)]
}
plateIdx = generated plate id
plateImg = generated plate image
Currently only tensorflow (TFRecord) export format is available.
- Augmenting data: rotating, scaling, adding gaussian blur, noise
- Balancing data: keep the number of characters balanced. It may result some images with a few bounding boxes.
- LabelMap: A label_map.pbtxt is automatically created with all different classes in the dataset.
$ cd BRLicensePlateGen
$ python datasetCreator.py
----------------------------------------------------------
Expected output:
How many plates do you want to generate?
Number of plates:5000
0 - Tensorflow
1 - YOLOV2
What is the model? (e.g: 0 or 1): 0
What is the output path? /home/user/BRLicensePlateGen/datasetFile
Want to augment the dataset? (y/n): y
Want to balance the data? (You may have images with few annotations) (y/n): y
Want to see generated plates? (y/n): n
------------------------------------------------------------------
Generating TensorFlow Dataset with (5000) license plates
TensorFlow dataset created successfully! Process took 19.082 seconds
- Fernando Rodrigues Jr - Initial work - Fernando