This project detects vehicles and their license plates in videos using YOLOv8, recognizes license numbers with OCR, and tracks vehicles across frames for robust results.
Video Input
|
v
[Frame Extraction]
|
v
[Vehicle Detection (YOLOv8)]
|
v
[Vehicle Tracking (SORT)]
|
v
[License Plate Detection (YOLOv8, fine-tuned)]
|
v
[License Plate Cropping]
|
v
[OCR Recognition (EasyOCR)]
|
v
[Result Storage (CSV)]
|
v
[Interpolation & Smoothing]
|
v
[Visualization]
- Vehicle Detection: Pre-trained YOLOv8n model
- License Plate Detection: YOLOv8 fine-tuned on this dataset (model weights)
- Tracking: SORT algorithm
- OCR: EasyOCR
-
Clone the repository
git clone <repo_url> cd Automatic-License-Plate-Recognition-using-YOLOv8
-
Create and activate a Python 3.10 environment
conda create --prefix ./env python=3.10 -y conda activate ./env
-
Install dependencies
pip install -r requirements.txt
-
Run detection and tracking on the sample video
python main.py
- Outputs:
test.csv
with detection and recognition results.
- Outputs:
-
Interpolate missing data for smooth tracking
python add_missing_data.py
- Outputs:
test_interpolated.csv
- Outputs:
-
Visualize results
python visualize.py
- Uses the interpolated CSV for smooth output.
main.py
: Runs detection, tracking, and recognitionadd_missing_data.py
: Interpolates missing data for smooth resultsvisualize.py
: Visualizes detection and tracking resultsrequirements.txt
: Python dependencieslicense_plate_detector.pt
,yolov8n.pt
: Model weightsvid.mp4
: Sample input video
- Make sure you have the model weights in the project directory.
- For custom videos, replace
vid.mp4
with your own file. - Results are saved as CSV files for further analysis or visualization.