Sub-millisecond plate reading with Compact Convolutional Transformers
Tiny transformer models that read cropped license plates fast, trainable in Keras 3 and deployable via ONNX.

What it does Fast-plate-ocr trains and runs lightweight OCR models that read text from already-cropped license plate images. It ships with pre-trained Compact Convolutional Transformer models in two sizes, and can optionally predict the plate’s country or region alongside the characters. Everything is built on Keras 3, so you can swap between TensorFlow, JAX, or PyTorch backends during training.
The interesting bit The library treats plate reading as a problem that should stay cheap. It uses Compact Convolutional Transformers—an architecture explicitly designed to avoid bloated models—to hit sub-millisecond inference on a desktop GPU via ONNX Runtime, with the smallest variant pushing over 3,000 plates per second.
Key highlights
- Built on Keras 3, so training can use TensorFlow, JAX, or PyTorch backends without rewriting model code.
- Ships with pre-trained S and XS variants; the XS model averages ~0.32 ms per plate on an RTX 3090 with ONNX Runtime.
- Optional region/country head on v2 models, returning both text and geographic origin.
- Exports cleanly to ONNX, CoreML, and TFLite for edge deployment.
- Includes a CLI for training and validation, plus a fine-tuning notebook for custom datasets.
Caveats
- The OCR expects cropped plates; you still need a separate detector to find the plate in the wild.
- ONNX Runtime is not installed by default—you must pick a backend extra (CPU, CUDA, OpenVINO, etc.) before inference works.
- Region recognition and export-friendly activations require the v2 models, not the v1 line.
Verdict Worth a look if you are building ALPR pipelines and need a fast, tiny OCR stage you can train, fine-tune, and ship to edge devices. Skip it if you need a single-box solution that also detects plates—this is only the reader.
Frequently asked
- What is ankandrew/fast-plate-ocr?
- Tiny transformer models that read cropped license plates fast, trainable in Keras 3 and deployable via ONNX.
- Is fast-plate-ocr open source?
- Yes — ankandrew/fast-plate-ocr is open source, released under the MIT license.
- What language is fast-plate-ocr written in?
- ankandrew/fast-plate-ocr is primarily written in Python.
- How popular is fast-plate-ocr?
- ankandrew/fast-plate-ocr has 617 stars on GitHub.
- Where can I find fast-plate-ocr?
- ankandrew/fast-plate-ocr is on GitHub at https://github.com/ankandrew/fast-plate-ocr.