Iranian License Plate Recognition (YOLOv8 ALPR)
High-accuracy, lightweight YOLOv8n object detection model trained to detect Iranian vehicle license plates and classify Persian digits and characters in real time.
Evaluation Results
Model training and validation progression across 20 epochs (trained on custom annotated Iranian License Plate dataset):
| Epoch | Precision (B) | Recall (B) | mAP@50 (B) | mAP@50-95 (B) | Box Loss (val) | Cls Loss (val) |
|---|---|---|---|---|---|---|
| 1 | 0.8910 | 0.7566 | 0.8015 | 0.6612 | 0.8948 | 0.7514 |
| 5 | 0.9470 | 0.8623 | 0.9086 | 0.7953 | 0.6736 | 0.3644 |
| 10 | 0.9526 | 0.8752 | 0.9216 | 0.8229 | 0.5798 | 0.2957 |
| 15 | 0.9524 | 0.8833 | 0.9259 | 0.8221 | 0.6191 | 0.2924 |
| 18 | 0.9532 | 0.8851 | 0.9275 | 0.8238 | 0.6174 | 0.2891 |
| 19 | 0.9508 | 0.8871 | 0.9277 | 0.8242 | 0.6168 | 0.2882 |
| 20 (Best) | 0.9513 | 0.8873 | 0.9280 | 0.8245 | 0.6165 | 0.2870 |
Training & Validation Loss / Metric Curves

Provided Model Formats
model.safetensors: SafeTensors weights for Hugging Face Hub ecosystem.iran_lpr_yolov8_640.onnx: Optimized ONNX model (640x640) for browser (ONNX Runtime Web / WebAssembly) and desktop applications.ncnn_640/&iran_lpr_ncnn_640.zip: Optimized NCNN model for Raspberry Pi / embedded edge devices (640x640).ncnn_320/&iran_lpr_ncnn_320.zip: Ultra-fast NCNN model for Raspberry Pi 3/4/5 (320x320).
Classes (41 Total)
- Plate Detection:
plate(0) - Persian Digits (1-10):
0,1,2,3,4,5,6,7,8,9 - Persian Characters (11-34):
alef,be,pe,te,se,jim,dal,sin,shin,sad,ta,za,ein,fe,ghaf,kaf,gaf,lam,mim,noon,vav,he,ye,ze - Special Markers (35-40):
taxi,disabled,police,D,S,protocol
Usage
Browser (ONNX Runtime Web)
Interactive Web Demo: Hugging Face Space
Python (ONNX Runtime)
import onnxruntime as ort
session = ort.InferenceSession("iran_lpr_yolov8_640.onnx")
# Inputs: images (1, 3, 640, 640)
# Outputs: output0 (1, 45, 8400)
Raspberry Pi (NCNN)
unzip iran_lpr_ncnn_640.zip -d ncnn_model