TinyOCR
Offline, English-first CPU OCR with 3.10 MB of bundled ONNX model files. TinyOCR packages a compressed pretrained PaddleOCR PP-OCRv6 recognizer and the original tiny detector, using RapidOCR and ONNX Runtime. It is an alpha release, not a newly trained model. The full installation and runtime memory are larger than the model files.
Install and use
Python 3.12 is supported. Windows, Linux and macOS are tested in CI.
python -m pip install tinyocr-onnx==0.1.0
tinyocr receipt.png
tinyocr receipt.png --json
python -m tinyocr receipt.png --no-words
from tinyocr import TinyOCR
ocr = TinyOCR() # Load once and reuse. No model downloads.
result = ocr("receipt.png")
print(result.text)
print(result.lines) # text, polygon, and [x0, y0, x1, y1] bounds
print(result.words) # text and native word polygons
data = result.to_dict() # JSON-serializable
Inputs are local image paths (PNG, JPEG, and other Pillow-supported images).
Coordinates are original-image pixels. Text uses a simple geometric row order,
not document-layout analysis. Blank images produce empty text and region lists.
words=False omits word geometry. Native word polygons can have zero area;
these are preserved to match the published benchmark.
The package name is tinyocr-onnx; the import and CLI are tinyocr. Do not
install the unrelated tinyocr distribution into the same environment. When
using this research checkout, run the installed package outside the repository
root so the research tinyocr/ directory does not shadow it.
Measured tradeoffs
The frozen pair is 3,099,213 bytes versus the original 6,319,431 bytes (50.96% smaller). The recognizer stores int8 weights but executes float32 math. This is a model-storage reduction; it is not a general speed or RAM reduction.
| Dataset | Images | Original E2E F1 (%) | TinyOCR E2E F1 (%) |
|---|---|---|---|
| SROIE | 341 | 41.036 | 40.779 |
| TextOCR | 3,027 | 43.412 | 43.334 |
| HierText | 1,721 | 40.330 | 40.204 |
In one timed pass, candidate p50 latency was 21.23% higher on SROIE, 16.16% higher on HierText, and 6.91% lower on TextOCR. Peak process working set was about 500 MiB for both models on the measured Windows machine. SROIE/TextOCR use the shared HierText polygon protocol, not their native leaderboard scores. Public pretraining overlap is unknown; these are comparative development results. See the full benchmark and limitations.
Inference uses one-thread CPU ONNX sessions, detector maximum side 960 px, recognition batch size one, and no orientation classifier. Initialization also sets OpenCV and common BLAS thread controls to one for the current process. Rotated text, difficult scenes and complex layouts can fail. English-first evaluation does not establish multilingual performance. No mobile performance claim is made.
Source and license
GitHub · Hugging Face models · PyPI
Apache-2.0. See LICENSE and NOTICE for PaddlePaddle and RapidAI attribution and the recognizer modification notice. Bundled artifacts are verified by SHA-256 on initialization. No evaluation datasets are included.
Metadata
Release files for tinyocr-onnx 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tinyocr_onnx-0.1.0.tar.gz | 2.7 MB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tinyocr_onnx-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 MB
Release files / tinyocr_onnx-0.1.0.tar.gz
| Download URL | tinyocr_onnx-0.1.0.tar.gz |
|---|---|
| Size | 2.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0a89722272ebfbd7286c857eeff1f85f6ea0eb95b5c0fb1956e2f0432afcc5f
|
|
BLAKE2b-256 checksum How to use checksums |
ed6762d3921af6df9bba5ce10b89192977efdceafdd24c6ba6d6117f40041f4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / tinyocr_onnx-0.1.0-py3-none-any.whl
| Download URL | tinyocr_onnx-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05a3752de71a04b5bfe363618c3c5c9aaab1e76ff820d2c87a882b1a0d1e7928
|
|
BLAKE2b-256 checksum How to use checksums |
2296422dd23b8a086276f9fbe82b3bb23ed5a0f895f588459da977631b3203fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logSecurity for tinyocr-onnx 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for tinyocr_onnx-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.