Automatic license-plate recognition for Sudanese plates — YOLO detector + fine-tuned OCR, with a reproducible benchmark.
🇸🇩 Sudan ALPR
Automatic license-plate recognition for Sudanese plates.
Finds the plate, reads the serial, confirms it's Sudanese, and decodes the state (wilaya) — all locally.
⭐ If this is useful to you, a star helps others find it.
A real plate, detected and read: 2G479 → Sudan / Gezira
It runs two deep-learning models locally on top of
FastALPR — no cloud, no API keys. I
wrote it because the old template-matching version I had fell apart the moment a
photo was taken at an angle or from a distance, which is basically every real
photo. This one holds up on messy, real-world shots.
---
## Contents
- How it works · Requirements · Install
- Project layout · Running it · Output
- Country, class & state recognition
- Accuracy & benchmark · Tests
- Honest caveats · Training
- Contributors · License
---
## At a glance
| | |
|---|---|
| **What it reads** | Sudanese plates: serial, country, plate class, state |
| **Plate classes** | 16 (private, government, police, army, diplomatic, UN, NGO, investment, transit, temporary…) |
| **OCR exact-match** | **82.6%** (vs 0% for the off-the-shelf model) |
| **Country detection** | **100%** on the labeled set |
| **Runs on** | CPU or Apple Silicon (CoreML), fully offline after first run |
| **Stack** | YOLO-v9 detector + fine-tuned CCT transformer OCR, via ONNX Runtime |
## How it works
It's a two-stage pipeline, same idea every serious ANPR system uses:
```
car photo
│
▼
[1] detect → a YOLO-v9 model locates the plate and crops it out
│
▼
[2] read → a CCT transformer OCR model turns the crop into text → 3KH3476
│
▼
[3] interpret → confirm it's Sudanese + decode the state → Sudan / Khartoum
```
Both models run on your machine through ONNX Runtime. On Apple Silicon they use
CoreML automatically, so it's quick. The OCR model is fine-tuned on real
Sudanese plates, so it reads the Latin serial line (e.g. `3KH 3476`) even when
the lighting is bad or the plate is tilted.
## Requirements
- * …