Skip to content

Cevheri-Software/cevheri_algo

Repository files navigation

Automatic License Plate Recognition using YOLOv8

Overview

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.

Algorithm Flow

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]

Model Details

  • Vehicle Detection: Pre-trained YOLOv8n model
  • License Plate Detection: YOLOv8 fine-tuned on this dataset (model weights)
  • Tracking: SORT algorithm
  • OCR: EasyOCR

Installation

  1. Clone the repository

    git clone <repo_url>
    cd Automatic-License-Plate-Recognition-using-YOLOv8
  2. Create and activate a Python 3.10 environment

    conda create --prefix ./env python=3.10 -y
    conda activate ./env
  3. Install dependencies

    pip install -r requirements.txt

Usage

  1. Run detection and tracking on the sample video

    python main.py
    • Outputs: test.csv with detection and recognition results.
  2. Interpolate missing data for smooth tracking

    python add_missing_data.py
    • Outputs: test_interpolated.csv
  3. Visualize results

    python visualize.py
    • Uses the interpolated CSV for smooth output.

File Structure

  • main.py: Runs detection, tracking, and recognition
  • add_missing_data.py: Interpolates missing data for smooth results
  • visualize.py: Visualizes detection and tracking results
  • requirements.txt: Python dependencies
  • license_plate_detector.pt, yolov8n.pt: Model weights
  • vid.mp4: Sample input video

Notes

  • 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages