TRaiFIC is an Automatic Number Plate Recognition (ANPR) system designed specifically for Nepali license plates. The system utilizes multiple machine learning models in a pipeline architecture to detect license plates, segment characters, and perform optical character recognition.
This project implements a complete ANPR pipeline:
- Plate Detection - Detects license plates from images or video frames
- Character Segmentation - Segments individual characters from the detected plate
- Character Recognition - Recognizes the segmented characters
The system is deployed as a Flask web application for easy interaction.
demo.mp4
ANPR/
├── application/ # Flask web application
│ ├── app.py # Main Flask application
│ ├── config.py # Application configuration
│ ├── model_loader.py # Model loading utilities
│ ├── image_processing.py # Image processing pipeline
│ ├── templates/ # HTML templates
│ └── static/ # Static assets (CSS, JS, images)
├── models/ # Machine learning models
│ ├── pd-traific/ # Plate detection model
│ ├── sg/ # Segmentation model
│ └── char-traiffic/ # Character recognition model
├── main.py
├── .python-version
└── pyproject.toml # Project dependencies and metadata
This project uses UV, an extremely fast Python package and project manager written in Rust. Follow these steps to set up the project:
- Python 3.10 or higher
- UV installed on your system
git clone https://github.com/sanzgrapher/TRaiFIC-ANPR-Nepali-Number-Plate-Detection-plus-Character-Recognition.git
cd ANPR
uv sync
This will install all dependencies defined in the pyproject.toml
file.
Start the Flask application:
cd application
uv run --flask run -p 3000
The web interface will be available at http://127.0.0.1:3000/
The ANPR system follows this workflow:
- Plate Detection (PD): Uses YOLOv8-based model to detect license plates in images
- Segmentation (SG): Isolates and segments characters from the detected plate
- Character Recognition (CHAR): Recognizes individual characters using a trained model
Model pipeline: PD → SG → CHAR