OnnxOCR PP-OCRv6 small
ONNX-based text detection and recognition with the official PP-OCRv6 small models and selectable ONNX Runtime or OpenVINO inference. The models and their character dictionary are included in the package; inference needs no model download or PaddlePaddle installation. Models are licensed under Apache-2.0.
This is the v6 distribution of ok-oldking/OnnxOCR, a fork of jingsongliujing/OnnxOCR.
Install
Use one OnnxOCR model distribution per environment: onnxocr-ppocrv5 and
onnxocr-ppocrv6 both install the onnxocr import package. To migrate an
existing environment, uninstall v5 before installing v6:
python -m pip uninstall onnxocr-ppocrv5
python -m pip install numpy opencv-python-headless "onnxocr-ppocrv6[onnx]"
Alternatively, install "onnxocr-ppocrv6[openvino]" for OpenVINO CPU or a
compatible Intel NPU. NumPy and OpenCV are application-managed dependencies,
matching the v5 distribution. Both inference backends are optional; select at
least one. Python 3.8+ is supported, subject to backend wheel availability.
Use
import cv2
from onnxocr.onnx_paddleocr import ONNXPaddleOcr
ocr = ONNXPaddleOcr(use_openvino=False)
result = ocr.ocr(cv2.imread("image.png"))
print(result)
The default detector and recognizer are PP-OCRv6 small, with its matching
18,708-entry character dictionary. The decoder adds CTC blank and space.
Enable OpenVINO with use_openvino=True and optional NPU selection with
use_npu=True. The optional use_angle_cls=True reuses the bundled v5-era
0/180-degree text-line classifier; the detector and recognizer remain v6 small.
The existing inference thresholds and preprocessing are retained.
The wheel contains only the small detector/recognizer, dictionary, provenance manifest, inference configurations, optional classifier, and rendering font. V6 tiny/medium and the v5 detector/recognizer are excluded. The API and OCR result format are the same as v5.
Build and release
Building requires Python 3.11+; CI uses Python 3.12.
python -m pip install -e ".[build]"
python scripts/download_ppocrv6.py --tiers small
python scripts/build_ppocrv6.py
python scripts/check_ppocrv6.py
python -m twine check dist/ppocrv6/*
The independent version is in packaging/ppocrv6.toml. The build script stages
the shared source and selected assets without rewriting the v5 project.
Both a source distribution and a wheel are emitted into dist/ppocrv6/.
To release version 0.0.1, push tag ppocrv6-v0.0.1. The
.github/workflows/publish-v6.yml workflow checks the tag against the v6
profile, downloads pinned official small models, builds and validates the
distributions, installs and tests the wheel, and publishes through PyPI
Trusted Publishing. A manual workflow dispatch builds and validates artifacts
without publishing.
CI smoke-tests both CPU backends. To run those checks locally, install the
development dependencies (python -m pip install -e ".[dev,build]") and run
python scripts/check_ppocrv6.py --smoke --backends onnxruntime openvino.
Before the first release, register a PyPI pending publisher with:
| Setting | Value |
|---|---|
| Project | onnxocr-ppocrv6 |
| GitHub owner | ok-oldking |
| Repository | OnnxOCR |
| Workflow filename | publish-v6.yml |
| Environment | pypi |
Metadata
Release files for onnxocr-ppocrv6 0.0.1
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 | Actions |
|---|---|---|---|---|
| onnxocr_ppocrv6-0.0.1.tar.gz | 32.6 MB | With provenance | Details for onnxocr_ppocrv6-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onnxocr_ppocrv6-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for onnxocr_ppocrv6-0.0.1-py3-none-any.whl |
Total release size: 65.3 MB
Release files / onnxocr_ppocrv6-0.0.1.tar.gz
| Download URL | onnxocr_ppocrv6-0.0.1.tar.gz |
|---|---|
| Size | 32.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a31336c3fec5368b696089c63be26052ad414ded25be9c881bbab75bd8f7bcfd
|
|
BLAKE2b-256 checksum How to use checksums |
bd1f2c8a999c9e9925b5387a7bc69bad74ce1908f2f75d75a72bf1820f017776
|
| 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 Nov 14, 2026.
Transparency logRelease files / onnxocr_ppocrv6-0.0.1-py3-none-any.whl
| Download URL | onnxocr_ppocrv6-0.0.1-py3-none-any.whl |
|---|---|
| Size | 32.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0574fe622a0be6a1017bb04c3941ed5efd6740fd2388a6b8041a5acee882678d
|
|
BLAKE2b-256 checksum How to use checksums |
9aa5a1afd12a25901a7a6f47c88e21b8e490790ad08705f56988eff86f2afeee
|
| 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 Nov 14, 2026.
Transparency logSecurity for onnxocr-ppocrv6 0.0.1
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
Both files in this release have been uploaded with provenance metadata.
Attestation for onnxocr_ppocrv6-0.0.1.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 Nov 14, 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.