Skip to content
Raff407Public

About

UK licence plate recognition: YOLOv8 detection, OpenCV deskew, OCR, Flask + SQLite

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

anpr-uk

UK licence plate recognition with YOLOv8 and OpenCV.

A YOLOv8n model, fine-tuned on 10k annotated plate images, finds licence plates in a photo and returns a padded crop of each one, sorted by confidence. On the dataset's unseen test split it scores precision 0.986, recall 0.945 and mAP50 0.975. A holdout script measures detection recall on real, hand-labelled UK photos, broken down by conditions such as angled, blurry or far away.

Setup

uv venv --python 3.11 .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
# NVIDIA GPU (CUDA 12.8, required for RTX 50-series); skip for CPU-only
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
uv pip install -r requirements.txt
pytest

Layout

Path Contents
src/detection YOLO plate detection
src/ocr Crop preprocessing, OCR, UK format validation
src/pipeline End-to-end orchestration
data/holdout Real photos + ground_truth.csv (both git-ignored for privacy; format in ground_truth.example.csv), never trained on
scripts Evaluation and data-prep entry points

Datasets


Note: AI assistance was used to help write the tests.

About

UK licence plate recognition: YOLOv8 detection, OpenCV deskew, OCR, Flask + SQLite

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages