A complete end-to-end system for detecting vehicles, localizing license plates, enhancing plate images, and performing OCR to extract Tunisian plate numbers. This project combines object detection, image processing, and deep-learning OCR to build a full ALPR pipeline suitable for real-time or batch processing.
# AutoPlateTN - Automatic Tunisian License Plate Recognition System
An end-to-end deep learning pipeline for detecting and recognizing Tunisian license plates in images. Built with state-of-the-art object detection and OCR models, featuring an interactive web interface.
Demo • Features • Quick Start • Results • Usage
---
## Demo
### Complete Pipeline Visualization
#### 1️ Vehicle Detection
*Cascade R-CNN detects all vehicles in the image with bounding boxes*
#### 2️ License Plate Detection
*Faster R-CNN localizes license plates on detected vehicles*
#### 3️ Plate Enhancement
*Advanced image preprocessing: denoising, upscaling (4x-6x), CLAHE, binarization*
#### 4️ Final OCR Results
*CRNN model reads characters and formats plates in Tunisian standard (Arabic + digits)*
---
## Features
### **Multi-Stage Detection Pipeline**
- **Stage 1**: Vehicle Detection using Cascade R-CNN
- **Stage 2**: License Plate Detection using Faster R-CNN
- **Stage 3**: Adaptive Image Enhancement (4 methods)
- **Stage 4**: OCR Recognition using CRNN with CTC Loss
### **Advanced Image Processing**
- **4 Enhancement Methods**: Original, Light, Full (recommended), Aggressive
- **Techniques**:
- Denoising (fastNlMeans)
- Super-resolution upscaling (4x-6x)
- Contrast enhancement (CLAHE)
- Gamma correction
- Bilateral filtering
- Adaptive binarization
- Morphological operations
### **Interactive Web Interface**
- Built with **Streamlit** for easy deployment
- Real-time processing with live visualization
- Adjustable confidence thresholds
- Multiple enhancement method selection
- Downloadable results
### **Tunisian Plate Support**
- Recognizes both standard and private plates
- Automatic formatting with Arabic text (تونس / نت)
- Proper number grouping and centering
- Format: `XXX تونس XXXX` or `XXXXXX نت`
---
## Quick Start
### Prerequisites
- Python 3.8+
- CUDA-capable GPU (optional, for faster processing)
- Git
### Installation
1. **Clone the repository**
```bash …