Skip to content

Automatic Number Plate Recognition (ANPR) using YOLOv8 and PaddleOCR for vehicle tracking and license plate extraction

License

Notifications You must be signed in to change notification settings

Bee1997/ANPR-YOLOv8-PaddleOCR

Repository files navigation

Automatic Number Plate Recognition (ANPR) with YOLOv8 and PaddleOCR

This project implements Automatic Number Plate Recognition (ANPR) using the YOLOv8 model for vehicle detection and tracking and PaddleOCR for optical character recognition (OCR) of license plates. The application detects vehicles, recognizes license plates, and logs them to a CSV file.

Project Structure

  • run.py: Main script that loads the YOLOv8 and PaddleOCR models, processes the video frame-by-frame, and annotates detected license plates.
  • requirements.txt: List of required packages to set up the environment.
  • demoVideo.mp4: Sample video file used for vehicle and license plate detection.
  • Car-List.csv: Output file that logs detected car IDs and corresponding license plate numbers.

How It Works

  1. Vehicle Detection and Tracking: YOLOv8 detects vehicles in the video frames.
  2. License Plate OCR: PaddleOCR recognizes and extracts license plate numbers from detected vehicles.
  3. CSV Logging: Each unique vehicle’s license plate number is saved to Car-List.csv.
  4. Annotated Video: A video (demoVideo_out.mp4) is generated with annotated bounding boxes and recognized license plate numbers.

Setup

Prerequisites

  • Python 3.x

Installation

Install the dependencies:

pip install -r requirements.txt

Usage

Run the Program

python run.py

Example

Below are some example visualizations generated by running run.py:

  • Annotated video(.gif) of detected vehicles: Annotated video(.gif)

  • CSV output(image) of recognized license plates.: CSV output image

  • Average processing time for each frame:

    • Average processing time per frame ~0.2392 seconds which includes:
      1. Reading the frame from the video.
      2. Running YOLOv8 for object detection and tracking.
      3. Cropping the regions of interest and running PaddleOCR.
      4. Annotating the frame with bounding boxes and text.

Future Enhancements

  • Reducing the processing time for each frame.
  • Improve OCR accuracy for license plates in challenging environments.
  • Extend the tracking to handle multiple vehicles with overlapping paths.
  • Integrate real-time camera feeds instead of processing static video files.

Acknowledgments

  • YOLOv8 - A state-of-the-art object detection model used for vehicle detection in this project.
  • PaddleOCR - A powerful OCR tool utilized for recognizing license plates.
  • Original video (demoVideo.mp4) from YouTube: YouTube Video Link.

About

Automatic Number Plate Recognition (ANPR) using YOLOv8 and PaddleOCR for vehicle tracking and license plate extraction

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages