Skip to main content

fastALPR

License Plate Recognition
fastALPR


fastALPR runs Automatic License Plate Recognition (ALPR) locally, in-process, using the fast-alpr Python package. Detection and OCR both run as ONNX models on your own hardware (CPU or GPU) - no external server, API key, or internet access is required at inference time, unlike components such as CodeProject.AI or Deepstack.

fastALPR is a post processor and works together with an object detector component (e.g. darknet, yolo, edgetpu). It runs on the bounding boxes of detected vehicles (e.g. car, truck) and looks for a license plate within them.

Configuration

Configuration example
/config/config.yaml
fastalpr:
license_plate_recognition:
cameras:
viseron_CHANGEME_camera:
labels:
- car
- truck
known_plates:
- ABC123
save_plates: true
min_confidence: 0.6
detector_model: yolo-v9-t-384-license-plate-end2end
ocr_model: cct-xs-v2-global-model
device: auto
fastalprmap required
fast-alpr configuration.

License plate recognition

License plate recognition runs as a post processor when a specific object is detected.

You can track known license plates by adding them to the known_plates list in the configuration. Known plates will be reported as binary sensors.

There is also a sensor entity that reports all the plates that have been detected. This can be used to trigger actions in other platforms, eg Home Assistant, when an unknown plate is detected.

Models

fastALPR uses two separate ONNX models: a detector model that locates license plates in the image, and an OCR model that reads the characters of a detected plate.

detector_model is a yolo-v9-*-license-plate-end2end model. The number in the name is the input resolution the model runs at, e.g. yolo-v9-t-384 resizes its input to 384x384. Higher resolutions (e.g. yolo-v9-s-608) are more accurate at finding small/distant plates but slower, while lower resolutions (e.g. yolo-v9-t-256) are faster but may miss smaller plates.

ocr_model reads the characters from the plate crop found by the detector. cct-*-global-model and global-plates-mobile-vit-v2-model are trained on plates from many regions/formats. european-plates-mobile-vit-v2-model and argentinian-plates-* are trained on region-specific plate formats and can be more accurate if your plates match one of those regions. xs and relu variants trade some accuracy for faster inference.

Troubleshooting

To enable debug logging for fastalpr, add the following to your config.yaml
/config/config.yaml
logger:
logs:
viseron.components.fastalpr: debug