This is a proof of concept of how to train my own YOLO
model to detect vehicle license plates.
Darknet
is used as a framework and the YOLO
algorithm to detect license plates, YOLOv4-tiny
is used because the main idea is to be able to detect license plate in real time.
On the other hand, I used Python
to draw and manipulate the steaming of the video.
The model was trained entirely with images of Argentine license plates (7200 images). If you want to obtain the images that were used to train your own model, you can download them here.
- Install the
Darknet
framework, I recommend the following repository https://github.com/hank-ai/darknet - Clone https://github.com/LeonardoFaggiani/JustAnotherAlpr.git
- Go to the darknet folder and modify the darknet.py file on line 328 "{path/to/your}/darknet.dll" replace {path/to/your} with the path where the darknet installer is located, save it.
- Go to the nn/license-plate path and modify the license-plate.data file and you must tell darknet where your license-plate.names file is, for example if you cloned the JustAnotherAlpr repository on the C drive, it would be C://JustAnotherAlpr/nn/license-plate/license-plate.names
Go to the root project and execute python -m ui.menu
python darknet_video.py --input samples\Testing-Driving.avi --weights ..\nn\license-plate\license-plate.weights --config_file ..\nn\license-plate\license-plate.cfg --data_file ..\nn\license-plate\license-plate.data
python darknet_video.py --input 0 --weights ..\nn\license-plate\license-plate.weights --config_file ..\nn\license-plate\license-plate.cfg --data_file ..\nn\license-plate\license-plate.data
python darknet_video.py --input 1 --weights ..\nn\license-plate\license-plate.weights --config_file ..\nn\license-plate\license-plate.cfg --data_file ..\nn\license-plate\license-plate.data
python darknet_video.py --input samples\Testing-Driving.avi --out_filename processed_Testing-Driving.avi --weights ..\nn\license-plate\license-plate.weights --config_file ..\nn\license-plate\license-plate.cfg --data_file ..\nn\license-plate\license-plate.data
python darknet_images.py --input samples\Testing-Image.jpg --weights ..\nn\license-plate\license-plate.weights --config_file ..\nn\license-plate\license-plate.cfg --data_file ..\nn\license-plate\license-plate.data --gpu
- Upload differents kind of images to train the model.
- Create Model
- Draw boxes in video streaming
- OCR
- Information of the owner of the vehicle license (Simulation)
- Move images to blob storage
- Create GUI with Tkinter 🛠️ (In Progress)
- Improve model (motorbike license plate)