Automatic Number Plate Recognition (ANPR) using YOLOv7 and pytesseract
Overview
This project implements an Automatic Number Plate Recognition (ANPR) system using YOLOv7 and pytesseract on a Jupyter Notebook. YOLOv7 is used for object detection and pytesseract is used for text recognition. The system is trained on a dataset of number plates and can detect and recognize the number plate.
Repository structure
-
Helpers
directory: containing an anotation conversion script and data augmentation notebook -
Main
directory: containing the main ANPR notebook, the images, as well as the YOLOv7 necessary files
Main Dependencies
The following libraries and packages are the main ones used in this project:
- OpenCV
- pytesseract
- torch
- numpy
Usage
To run the ANPR system, follow these steps:
- Clone this repository and open the
ANPR_TrainYOLOv7.ipynb
file in Jupyter Notebook, or useANPR_TrainYOLOv7-colab.ipynb
on Google Colab - Make sure all dependencies are installed.
- Run all cells in the notebook to load the trained model and start the ANPR system.
- The ANPR system can be tested by providing an image from the
/Main/taken_test_car_images
directory
Results
The ANPR system is able to detect and recognize number plates with a high accuracy.
Helpers
-
convert_voc_to_yolo.py
:This is a Python script that converts annotated images in PASCAL VOC format into the format required by YOLO object detection. It iterates over a list of directories containing annotated images, converts the annotations for each image, and saves the converted annotations in a specified output directory.
-
images_aug.ipynb
:This notebook is used to read images and its corresponding label files and performs data augmentation (such as Scale, Translate, Rotate, Shear) using the data_aug library.
Useful Documents
Contact
If you have any questions or feedback, please contact: