How 1hemmem/algerian-license-plates-recegnition-system works
Project type and purpose
• This is a specialized data-processing pipeline written in Python for end-to-end license-plate recognition on video streams.
• It ingests a video, detects cars and license plates per frame (YOLO), tracks objects across frames (DeepSORT), selects the best plate images, runs OCR on them, and persists results (images, text, timestamps).
File structure
• Top-level:
• README.md – project overview and usage
• models/ – saved YOLO model weights (best.pt, yolov10n.pt)
• src/requirements.txt – Python dependencies
• src/prod/ – production pipeline
• app.py – entry point, orchestrates the pipeline
• Filter.py – logic to discard duplicate detections, keep best frame
• GeminiOcr.py – wrapper around OCR engine
• Utils.py – shared utilities (e.g., frame I/O, timestamping)
• src/train/ – training pipeline (data splitting, formatting, training scripts)
Key insights from README
• The emphasis on:
• Object detection (YOLO) without duplicate suppression
• Object tracking & re-identification (DeepSORT) to handle repeated detections
• Frame quality assessment to feed OCR the clearest plate image
• No frontend/UI – this is purely a back-end processing service.
Main components
a. Video Input Module
• Reads video frames from file or stream
b. Frame Extraction & Preprocessing
• Optional resizing, normalization (in Utils)
c. Object Detection Service
• YOLO model (models/*.pt)
d. Object Tracking Service
• DeepSORT tracker instance (manages object IDs across frames)
e. Duplicate Filter / Best-Frame Selector
• Filter.py: logic to decide which frame(s) to OCR per tracked object
f. OCR Engine
• GeminiOcr.py: calls OCR library (local or external service)
g. Persistence Layer
• Stores:
• Cropped plate images (file system or blob storage)
• Full-car images
• Extracted text + timestamp (could be a database or CSV)
h. Training Subsystem (side-by-side)
Relationships & data flow
Video Input → Frame Extraction → Detection → Tracking → Duplicate Filtering → OCR → Persistence
Architectural patterns & principles
• Modular pipeline: each step is a distinct module/service
• OOP design: each component encapsulated in a class or module
• Separation of concerns: detection, tracking, filtering, OCR, and storage are decoupled
Detail level
• Don’t just show “ML module” – break it into YOLO Detector + DeepSORT Tracker + Filter + OCR