A robust end-to-end pipeline for automatic vehicle and license plate detection, tracking, and recognition in videos. Built with YOLOv8, custom-trained models, SORT tracking, and OCR, this project enables accurate extraction and export of license plate data from traffic footage.
- Vehicle Detection: Uses YOLOv8 COCO model for robust vehicle localization.
- License Plate Detection: Employs a custom YOLOv8 model for precise license plate detection.
- Vehicle Tracking: Integrates SORT for multi-object tracking across frames.
- OCR Recognition: Utilizes EasyOCR for reading license plate text from detected plates.
- CSV Export: Outputs bounding boxes, recognized text, and scores to CSV for further analysis.
- Python
- YOLOv8 (via Ultralytics)
- OpenCV
- NumPy
- EasyOCR
- SORT (repo)
- Custom License Plate Detector Model: Trained on Roboflow License Plate Recognition Dataset
- SORT Tracking Module: Clone from https://github.com/abewley/sort
- Sample Video for Testing: Pexels Traffic Flow Video
main.py # Main pipeline: detection, tracking, OCR, export
utils.py # Utility functions (OCR, formatting, helpers)
visualise.py # Visualization and video output
models/
license_plate_detector.pt # Custom-trained YOLOv8 license plate model
yolov8n.pt # YOLOv8 COCO model
outputs/
main.csv # Output CSV with results
test.csv # Additional output
sort/ # SORT tracking module (clone from repo)
requirements.txt # Python dependencies
sample.mp4 # Sample input video
out.mp4 # Output visualization video
-
Clone this repository:
git clone github.com/AdamNgazzou/Automated-License-Plate-Recognition-YOLOv8 cd licence_plate_detection -
Install Python dependencies:
pip install -r requirements.txt
-
Clone the SORT tracking module:
git clone https://github.com/abewley/sort.git
Run inference on the sample video:
python main.py- Output CSV: Results are saved in
outputs/main.csv - Output Video: Visualization saved as
out.mp4
You can adjust input/output paths in main.py and visualise.py as needed.
-
CSV Output:
All detected vehicles, license plates, bounding boxes, and recognized text are exported tooutputs/main.csv. -
Visualization:
Annotated video with bounding boxes and recognized plates is saved asout.mp4.
- Support for multi-language license plates
- Real-time inference and streaming support
Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request.
