{"id":14970747,"url":"https://github.com/ankandrew/fast-plate-ocr","last_synced_at":"2026-03-14T22:58:01.251Z","repository":{"id":117311095,"uuid":"285701949","full_name":"ankandrew/fast-plate-ocr","owner":"ankandrew","description":"Lightweight \u0026 fast OCR models for license plate text recognition.","archived":false,"fork":false,"pushed_at":"2026-03-07T23:33:19.000Z","size":281168,"stargazers_count":410,"open_issues_count":3,"forks_count":58,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-03-08T04:46:43.226Z","etag":null,"topics":["albumentations","jax","keras","keras3","license-plate","license-plate-check","license-plate-ocr","license-plate-reader","license-plate-recognition","ocr","ocr-python","onnx","plate-ocr","plate-recognition","pytorch","tensorflow"],"latest_commit_sha":null,"homepage":"https://ankandrew.github.io/fast-plate-ocr/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankandrew.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing/development.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-07T00:46:17.000Z","updated_at":"2026-03-07T08:16:11.000Z","dependencies_parsed_at":"2024-05-06T03:25:02.599Z","dependency_job_id":"cfe2e99d-f958-40fb-af9c-72aeeaa2c567","html_url":"https://github.com/ankandrew/fast-plate-ocr","commit_stats":{"total_commits":303,"total_committers":1,"mean_commits":303.0,"dds":0.0,"last_synced_commit":"f0f74b6c69e56fcb23046374ca810e3235ea3e5f"},"previous_names":["ankandrew/fast-plate-ocr"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/ankandrew/fast-plate-ocr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankandrew%2Ffast-plate-ocr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankandrew%2Ffast-plate-ocr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankandrew%2Ffast-plate-ocr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankandrew%2Ffast-plate-ocr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankandrew","download_url":"https://codeload.github.com/ankandrew/fast-plate-ocr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankandrew%2Ffast-plate-ocr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30520783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-14T19:51:21.629Z","status":"ssl_error","status_checked_at":"2026-03-14T19:51:12.959Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["albumentations","jax","keras","keras3","license-plate","license-plate-check","license-plate-ocr","license-plate-reader","license-plate-recognition","ocr","ocr-python","onnx","plate-ocr","plate-recognition","pytorch","tensorflow"],"created_at":"2024-09-24T13:44:05.087Z","updated_at":"2026-03-14T22:58:01.245Z","avatar_url":"https://github.com/ankandrew.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fast \u0026 Lightweight License Plate OCR\n\n[![Actions status](https://github.com/ankandrew/fast-plate-ocr/actions/workflows/test.yaml/badge.svg)](https://github.com/ankandrew/fast-plate-ocr/actions)\n[![Actions status](https://github.com/ankandrew/fast-plate-ocr/actions/workflows/release.yaml/badge.svg)](https://github.com/ankandrew/fast-plate-ocr/actions)\n[![Keras 3](https://img.shields.io/badge/Keras-3-red?logo=keras\u0026logoColor=red\u0026labelColor=white)](https://keras.io/keras_3/)\n[![image](https://img.shields.io/pypi/v/fast-plate-ocr.svg)](https://pypi.python.org/pypi/fast-plate-ocr)\n[![image](https://img.shields.io/pypi/pyversions/fast-plate-ocr.svg)](https://pypi.python.org/pypi/fast-plate-ocr)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![ONNX Model](https://img.shields.io/badge/model-ONNX-blue?logo=onnx\u0026logoColor=white)](https://onnx.ai/)\n[![Hugging Face Spaces](https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-orange)](https://huggingface.co/spaces/ankandrew/fast-alpr)\n[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://ankandrew.github.io/fast-plate-ocr/)\n[![image](https://img.shields.io/pypi/l/fast-plate-ocr.svg)](https://pypi.python.org/pypi/fast-plate-ocr)\n\n![Intro](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/readme_demo.gif)\n\n---\n\n## Introduction\n\n**Lightweight** and **fast** OCR models for license plate text recognition. You can train models from scratch or use\nthe trained models for inference.\n\nThe idea is to use this after a plate object detector, since the OCR expects the cropped plates.\n\n## Features\n\n- **Keras 3 Backend Support**: Train seamlessly using **[TensorFlow](https://www.tensorflow.org/)**, **[JAX](https://github.com/google/jax)**, or **[PyTorch](https://pytorch.org/)** backends 🧠\n- **Efficient Execution**: **Lightweight** models that are cheap to run 💰\n- **ONNX Runtime Inference**: **Fast** and **optimized** inference with **[ONNX runtime](https://onnxruntime.ai/)** ⚡\n- **User-Friendly CLI**: Simplified **CLI** for **training** and **validating** OCR models 🛠️\n- **Region Recognition (Optional)**: Predict **region/country** of the license plate 🌍\n- **Model HUB**: Access to a collection of **pre-trained models** ready for inference 🌟\n- **Train**/**Fine-tune**: Easily train or **fine-tune** your own models 🔧\n- **Export-Friendly**: Export easily to **CoreML**, **TFLite**, or **ONNX** formats 📦\n\n## Available Models\n\nOptimized, ready to use models with config files for inference or fine-tuning.\n\n| Model Name               | Size | Arch                                                                                                                         | b=1 Avg. Latency (ms) | Plates/sec (PPS) | Model Config                                                                                                                     | Plate Config                                                                                                                     | Val Results                                                                                                           |\n|--------------------------|------|------------------------------------------------------------------------------------------------------------------------------|-----------------------|------------------|----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| `cct-s-v2-global-model`  | S    | [CCT](https://ankandrew.github.io/fast-plate-ocr/latest/training/config/model_config/#compact-convolutional-transformer-cct) | **0.6758**            | **1479.61**      | [model_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_s_v2_global_model_config.yaml)  | [plate_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_s_v2_global_plate_config.yaml)  | [results](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_s_v2_global_val_results.json)  |\n| `cct-xs-v2-global-model` | XS   | [CCT](https://ankandrew.github.io/fast-plate-ocr/latest/training/config/model_config/#compact-convolutional-transformer-cct) | **0.4664**            | **2144.14**      | [model_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_xs_v2_global_model_config.yaml) | [plate_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_xs_v2_global_plate_config.yaml) | [results](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_xs_v2_global_val_results.json) |\n| `cct-s-v1-global-model`  | S    | [CCT](https://ankandrew.github.io/fast-plate-ocr/latest/training/config/model_config/#compact-convolutional-transformer-cct) | **0.5877**            | **1701.63**      | [model_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_s_v1_global_model_config.yaml)  | [plate_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_s_v1_global_plate_config.yaml)  | [results](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_s_v1_global_val_results.json)  |\n| `cct-xs-v1-global-model` | XS   | [CCT](https://ankandrew.github.io/fast-plate-ocr/latest/training/config/model_config/#compact-convolutional-transformer-cct) | **0.3232**            | **3094.21**      | [model_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_xs_v1_global_model_config.yaml) | [plate_config.yaml](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_xs_v1_global_plate_config.yaml) | [results](https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_xs_v1_global_val_results.json) |\n\n\u003e [!TIP]\n\u003e 🚀 Try the above models in [Hugging Spaces](https://huggingface.co/spaces/ankandrew/fast-alpr).\n\n\u003e [!NOTE]\n\u003e **Benchmark Setup**\n\u003e\n\u003e These results were obtained with:\n\u003e\n\u003e - **Hardware**: NVIDIA RTX 3090 GPU\n\u003e - **Execution Providers**: `['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider']`\n\u003e - **Install dependencies**: `pip install fast-plate-ocr[onnx-gpu]`\n\nExplore the [Model Zoo](https://ankandrew.github.io/fast-plate-ocr/latest/inference/model_zoo/) to see all available models.\n\n## Inference\n\nFor doing inference, install:\n\n```shell\npip install fast-plate-ocr[onnx-gpu]\n```\n\nBy default, **no ONNX runtime is installed**. To run inference, you **must** install at least one ONNX backend using an appropriate extra.\n\n| Platform/Use Case  | Install Command                             | Notes                |\n|--------------------|---------------------------------------------|----------------------|\n| CPU (default)      | `pip install fast-plate-ocr[onnx]`          | Cross-platform       |\n| NVIDIA GPU (CUDA)  | `pip install fast-plate-ocr[onnx-gpu]`      | Linux/Windows        |\n| Intel (OpenVINO)   | `pip install fast-plate-ocr[onnx-openvino]` | Best on Intel CPUs   |\n| Windows (DirectML) | `pip install fast-plate-ocr[onnx-directml]` | For DirectML support |\n| Qualcomm (QNN)     | `pip install fast-plate-ocr[onnx-qnn]`      | Qualcomm chipsets    |\n\n\n### Usage\n\nTo predict from disk image:\n\n```python\nfrom fast_plate_ocr import LicensePlateRecognizer\n\nm = LicensePlateRecognizer('cct-s-v2-global-model')\nprint(m.run('test_plate.png'))\n```\n\nIf your model includes a **region head** (and `plate_regions` is defined in the plate config), predictions\nalso include `region`. The `region_prob` field is populated when `return_confidence=True`:\n\n```python\nfrom fast_plate_ocr import LicensePlateRecognizer\n\nm = LicensePlateRecognizer('cct-s-v2-global-model')\npred = m.run('test_plate.png', return_confidence=True)[0]\nprint(pred.region, pred.region_prob)\n```\n\nTo run a model benchmark:\n\n```python\nfrom fast_plate_ocr import LicensePlateRecognizer\n\nm = LicensePlateRecognizer('cct-s-v2-global-model')\nm.benchmark()\n```\n\nFor more examples and the full API, see the\n[Inference Guide](https://ankandrew.github.io/fast-plate-ocr/latest/inference/running_inference/) and\n[Reference](https://ankandrew.github.io/fast-plate-ocr/latest/reference/).\n\n## Training\n\nYou can train models from scratch or fine-tune a pre-trained one using your own license plate dataset.\n\nInstall the training dependencies:\n\n```shell\npip install fast-plate-ocr[train]\n```\n\n### Fine-tuning Tutorial\n\nA complete tutorial notebook is available for fine-tuning a license plate OCR model on your own dataset:\n[`examples/fine_tune_workflow.ipynb`](examples/tutorial_fine_tune_plate_model.ipynb). It covers the full workflow, from\npreparing your dataset to training and exporting the model.\n\nFor full details on data preparation, model configs, fine-tuning, and training commands, check out the\n[docs](https://ankandrew.github.io/fast-plate-ocr/1.0/training/intro/).\n\nFor **region recognition** and export-friendly activations, use the v2 models.\n\n## Contributing\n\nContributions to the repo are greatly appreciated. Whether it's bug fixes, feature enhancements, or new models,\nyour contributions are warmly welcomed.\n\nTo start contributing or to begin development, you can follow these steps:\n\n1. Clone repo\n    ```shell\n    git clone https://github.com/ankandrew/fast-plate-ocr.git\n    ```\n2. Install all dependencies (make sure you have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed):\n    ```shell\n    make install\n    ```\n3. To ensure your changes pass linting and tests before submitting a PR:\n    ```shell\n    make checks\n    ```\n\n## Citations\n\n```bibtex\n@article{hassani2021escaping,\n    title   = {Escaping the Big Data Paradigm with Compact Transformers},\n    author  = {Ali Hassani and Steven Walton and Nikhil Shah and Abulikemu Abuduweili and Jiachen Li and Humphrey Shi},\n    year    = 2021,\n    url     = {https://arxiv.org/abs/2104.05704},\n    eprint  = {2104.05704},\n    archiveprefix = {arXiv},\n    primaryclass = {cs.CV}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankandrew%2Ffast-plate-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankandrew%2Ffast-plate-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankandrew%2Ffast-plate-ocr/lists"}