# 🇩🇿 Algerian License Plate Recognition (ALPR)
A production-ready pipeline for detecting and recognizing Algerian License Plates. This repository uses a highly tuned **YOLOv8s** architecture to locate the plates and a custom **CRNN** (CNN + BiLSTM + CTC) Optical Character Recognition engine to accurately transcribe the characters using intelligent wilaya-code formatting.
## 🌟 Key Features
- **Blazing Fast Detection**: Uses the state-of-the-art YOLOv8-Small network.
- **Robust OCR Engine**: Character recognition trained with Albumentations (handling blurs, shadows, and perspective shifts).
- **Smart Formatting**: Algerian plate rules are baked in. Extracts the 2-digit wilaya code dynamically to error-correct edge digits (e.g. `NNNNN WWW WW`).
- **Batch Processing Pipeline**: Quickly inferences over datasets and outputs structured CSV files with individual plate crops.
- **Clean Architecture**: Designed for modularity, extendability, and maintainability.
---
## 🏗 Directory Structure
```text
algerian-lpr/
├── data/ # [Ignored] Raw images and YOLO-formatted datasets
├── weights/ # [Ignored] Pretrained and fine-tuned `.pt` models
├── output/ # [Ignored] Cropped plates and results.csv logs
│
├── src/ # Core Application Source Code
│ ├── models/ # Neural network definitions (CRNN, BiLSTM)
│ ├── data/ # Dataset loaders and Albumentations augmentations
│ ├── training/ # YOLO and OCR model training scripts
│ ├── inference/ # Batch pipeline and single-image testing modules
│ └── utils/ # Plate formatting and OCR decoding utilities
│
└── requirements.txt # Application dependencies
```
---
## ⚙️ Installation
1. **Clone the repository:**
```bash
git clone
github.com
cd algerian-lpr
```
2. **Create a Virtual Environment:**
```bash
python -m venv venv
source venv/bin/activate # On Linux/macOS
venv\Scripts\activate …