A lightweight, testable license plate recognition (LPR) service. The project provides:
- A reusable Python recognition pipeline.
- Optional OpenCV + Tesseract OCR integration.
- A FastAPI HTTP service for image uploads.
- A CLI for local batch-style use.
- Unit tests and CI-ready quality checks.
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev,vision]'
pytestIf you only want to run tests without native OCR dependencies, install .[dev].
lpr-app ./examples/plate.jpg --jsonuvicorn lpr_app.api:app --reload
curl -F "file=@./examples/plate.jpg" http://127.0.0.1:8000/recognizeHealth checks are available at GET /health.
The recognition flow is intentionally small and testable:
- Validate that the input image path exists.
- Extract raw OCR text with an injectable OCR engine.
- Normalize OCR noise into a plate-like alphanumeric candidate.
- Return a structured
RecognitionResult.
The default OCR engine uses OpenCV preprocessing and pytesseract. Tests inject a stub OCR engine so the core pipeline remains deterministic and fast.
pip install -e '.[dev]'
ruff check .
pytestSee docs/ROADMAP.md for recommended next milestones.