Install
anpr-pipeline needs Python 3.11 to 3.14. The models download on first use (about 30 MB) and are cached after that.
From PyPI
Section titled “From PyPI”pip install anpr-pipelineThis installs the anpr command. Check it:
anpr versionOptional extras
Section titled “Optional extras”| Extra | What it adds |
|---|---|
anpr-pipeline[gpu] |
onnxruntime-gpu, for running the models on an NVIDIA GPU. |
anpr-pipeline[otel] |
OpenTelemetry tracing for the API. See Monitoring. |
With Docker
Section titled “With Docker”The repository has a Dockerfile and a docker-compose.yml. The service needs a secret to hash
plates with, called the pepper. Generate one and start the service:
git clone https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR.gitcd Automatic_Number_Plate_Recognition_YOLO_OCRexport ANPR_PLATE_HMAC_PEPPER="$(python -c 'import secrets; print(secrets.token_hex(32))')"docker compose up --buildOpen http://localhost:8000. The database lives in the anpr-data volume, so it survives restarts.
Keep the pepper: with a different one, the same plate gets a different hash. See
Privacy for why.
From source
Section titled “From source”You need uv.
git clone https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR.gitcd Automatic_Number_Plate_Recognition_YOLO_OCRuv sync --all-extras --group devcp .env.example .envuv run anpr generate-pepper # paste the output into .env as ANPR_PLATE_HMAC_PEPPERuv run anpr serveNext: read your first plate.