Skip to content

πŸš— Real-time ALPR system – detects vehicles, reads license plates, and visualizes results live.

Notifications You must be signed in to change notification settings

chandaAvishek/alpr-real-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— ALPR System - Automatic License Plate Recognition

Building a real-time license plate detection system using YOLOv8 and EasyOCR

Python Ultralytics OpenCV Status

Table of Contents

Overview

I'm working on an ALPR system that can automatically detect and read license plates from images and videos in real-time. The goal is to create something that works well in different lighting conditions and camera angles - basically making it robust enough for real-world use.

This project tackles the challenge of automated vehicle identification, which has practical applications in parking management, traffic monitoring, and security systems.

Features

  • Real-time processing: Works with live video feeds
  • Custom trained model: Built using 11,776+ CCPD dataset images for high accuracy
  • Handles Chinese plates: Specialized character recognition for Chinese license plates
  • Weather resistant: Performs well across different lighting and environmental conditions
  • Modular design: Easy to integrate into existing systems
  • Well documented: Includes detailed exploration notebooks showing the development process

System Architecture

The system works in stages:

  1. Data Processing: I explored and converted the CCPD dataset to YOLO format
  2. Detection Module: Custom YOLOv8 model finds license plates in images
  3. Recognition Module: EasyOCR extracts the actual text from detected plates
  4. Pipeline Integration: Everything works together seamlessly
  5. User Interface: Planning a Streamlit dashboard for easy interaction

Installation

What you'll need

  • Python 3.8 or higher
  • A decent GPU helps (but not required - I optimized for CPU training too)
  • At least 8GB RAM if you want to train from scratch

Getting started

  1. Get the code
git clone https://github.com/yourusername/alpr-system.git
cd alpr-real-time
  1. Set up your environment
python -m venv alpr_env
source alpr_env/bin/activate 
  1. Install everything
pip install -r requirements.txt

Usage

Running license plate detection

from src.detect_plate import LicensePlateDetector
# Setup the Detector
detector = LicensePlateDetector()

# Load the trained model
detector.load_model('models/license_plate_detection/best.pt')

# Detect plates in your image
results = detector.detect_plates('path/to/image.jpg')

Exploring the dataset

jupyter notebook notebooks/01_ccpd_exploration.ipynb

Development Progress

Completed (Week 1)

  • Project setup and environment configuration
  • CCPD dataset exploration and analysis (11,776 images)
  • Dataset conversion pipeline (CCPD β†’ YOLO format)
  • YOLOv8 training pipeline implementation
  • Model training completed with 99.5% mAP50 accuracy
  • CPU-optimized training configuration
  • Professional project documentation

Training Results

  • Model Performance: 99.5% mAP50 accuracy achieved in 4 epochs
  • Training Method: YOLOv8n with early stopping (patience=10)
  • Dataset: 11,776 CCPD images with Chinese license plates
  • Status: Production-ready model available at models/license_plate_detection/yolov8_ccpd_optimized/weights/best.pt

Week 2 Day 1 - COMPLETE

  • OCR integration with EasyOCR
  • Complete ALPR pipeline (YOLOv8 β†’ OCR β†’ Text extraction)
  • 95% OCR confidence achieved on test license plates
  • Energy-efficient testing framework with model reuse
  • End-to-end license plate text recognition working

OCR Integration Results

  • OCR Performance: 95% confidence on synthetic test plates
  • Pipeline Status: YOLOv8 detection + EasyOCR text extraction functional
  • Language Support: English and Chinese character recognition
  • Implementation: src/ocr_reader.py with preprocessing and error correction
  • Testing: Comprehensive test suite in src/test_ocr.py
  • Character Accuracy: Handles common OCR errors (Oβ†’0, Iβ†’1, Sβ†’5, Zβ†’2)

Week 2 Day 2 - COMPLETE

  • Video processing pipeline implementation
  • Enhanced testing framework with video capabilities
  • Test video generation for development and validation
  • Live camera feed processing integration
  • Frame-by-frame license plate detection in video streams

Video Processing Results

  • Video Support: MP4 file processing with configurable frame skipping for performance
  • Live Camera: Real-time webcam integration with detection visualization
  • Test Generation: Synthetic video creation with moving license plates for validation
  • Performance: Optimized processing every 3rd frame for real-time capability
  • Implementation: Extended src/utils.py with video utilities and enhanced src/test_ocr.py
  • Processing Results: Successfully detecting and reading license plates in video sequences

Next Steps (Day 3)

  • Streamlit dashboard interface development
  • Real-time video stream integration with web interface
  • Detection history and logging system
  • Performance metrics dashboard
  • User interface for video upload and processing

About

πŸš— Real-time ALPR system – detects vehicles, reads license plates, and visualizes results live.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published