Skip to main content

PP-OCRv6 small RTen models for pylopdf's optional offline OCR engine

Project description

pylopdf-ocr-models

A data-only package containing the PP-OCRv6 small detector, recognizer, and multilingual character dictionary used by pylopdf. The models run locally through pylopdf's pure-Rust RTen backend; OCR does not require a system executable, ONNX Runtime, an ONNX parser at runtime, or network access.

Install it through the main package extra:

pip install "pylopdf[ocr]"

The small PP-OCRv6 tier is intended for mobile and desktop use. Its unified model supports 50 languages, including Japanese, Simplified Chinese, Traditional Chinese, and English.

Bundled artifacts

File Purpose SHA-256
PP-OCRv6_det_small.rten Multilingual text detection 57c5778be784d7aace438a4ea1926864a7b5fd3d49c8e577799f8a83e8dcb022
PP-OCRv6_rec_small.rten Multilingual text recognition b6eef947901c5ff0bf6ee62d8b46f58b1423666f0ae0c87b2f42127502925f8f
ppocrv6_dict.txt Recognition character dictionary b5f2bfe2bdd9448429e3e82b51c789775d9b42f2403d082b00662eb77e401c5d

The installed package also includes these values in SHA256SUMS. Release CI builds the wheel and sdist twice and requires byte-identical output. It then installs both formats into isolated environments, verifies distribution metadata and license files, and streams each installed artifact through SHA-256 before publishing.

The source ONNX artifacts and dictionary are the PP-OCRv6 small files listed in RapidOCR's pinned model manifest and downloaded from its versioned v3.9.2 model repository. They originate from PaddleOCR; RapidOCR converted and distributes the ONNX forms.

Source URL SHA-256
Detector ONNX PP-OCRv6_det_small.onnx 090f04abcd9d9a7498bc4ebf677e4cb9bdce1fe4197ddb7e529f1ef44e1ff94f
Recognizer ONNX PP-OCRv6_rec_small.onnx 6f327246b50388f3c176ae304bd95767ea6dc0c9ae92153ef8cbe210b3c14884
Dictionary ppocrv6_dict.txt b5f2bfe2bdd9448429e3e82b51c789775d9b42f2403d082b00662eb77e401c5d

Reproducing the RTen conversion

After downloading and verifying the source files above, reproduce the bundled model data from the repository root with:

uvx --from rten-convert==0.22.0 rten-convert \
  --no-infer-shapes PP-OCRv6_det_small.onnx PP-OCRv6_det_small.rten
uvx --from rten-convert==0.22.0 rten-convert \
  --no-infer-shapes PP-OCRv6_rec_small.onnx PP-OCRv6_rec_small.rten

rten-convert embeds each source ONNX SHA-256 in the RTen file. Conversion is deterministic: repeating the commands produces the artifact hashes in the first table. Numerical outputs were also checked against the ONNX models before packaging. The character dictionary remains a separate input because RTen's conversion format does not preserve the ONNX recognizer's custom character metadata.

Model copyright is held by Baidu. PaddleOCR and RapidOCR are licensed under Apache License 2.0. See LICENSE and NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylopdf_ocr_models-0.1.0.tar.gz (26.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylopdf_ocr_models-0.1.0-py3-none-any.whl (26.6 MB view details)

Uploaded Python 3

File details

Details for the file pylopdf_ocr_models-0.1.0.tar.gz.

File metadata

  • Download URL: pylopdf_ocr_models-0.1.0.tar.gz
  • Upload date:
  • Size: 26.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pylopdf_ocr_models-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b41c50199465fb53dc41ae72ae33fd96197de764b15ecd3b46b56092b95440df
MD5 efecadfde29094a26716f15de1e335a4
BLAKE2b-256 07646b44b5a824aefce2a1a7ec6cdbae372516b9789b3c06989a815d1e34fb0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylopdf_ocr_models-0.1.0.tar.gz:

Publisher: release-ocr-models.yml on yhay81/pylopdf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylopdf_ocr_models-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylopdf_ocr_models-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 067acc9a39ca0dc7dd2b059c2180f9afa44c101a63d56c944b0b9c340d0c906d
MD5 5d31b4e51a453bdcacb078a7e4095ce6
BLAKE2b-256 eb2f600942fa646d4005cf7d3fc5ace072ba852f04f14bf5d4b63dc98743c94c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylopdf_ocr_models-0.1.0-py3-none-any.whl:

Publisher: release-ocr-models.yml on yhay81/pylopdf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page