rizzo-ocr

ONNX models used by the local OCR of Rizzo PII to read scanned documents and photos on the CPU, with ONNX Runtime only (no Paddle, no PyTorch).

This repository hosts the pieces that PaddlePaddle does not publish in ONNX format. Everything else (PP-OCRv6 detection/recognition, SLANet_plus, PP-DocLayout_plus-L) is downloaded from the official PaddlePaddle/<model>_onnx repositories.

Folder Model Size Notes
PP-DocLayout-M/ PaddlePaddle/PP-DocLayout-M (PicoDet-L, 23 layout classes) 23 MB converted with paddle2onnx 2.1.0 from the official inference weights, no fine-tuning, weights unchanged

Each folder contains inference.onnx (the graph + weights) and inference.yml (the original PaddleX config: label list and preprocessing).

Usage

In Rizzo PII the models are fetched by scripts/fetch_ocr_models.py:

python scripts/fetch_ocr_models.py          # -> models/ocr/

Standalone:

from huggingface_hub import hf_hub_download
import onnxruntime as ort

path = hf_hub_download("rizzoaiacademy/rizzo-ocr", "inference.onnx", subfolder="PP-DocLayout-M")
sess = ort.InferenceSession(path, providers=["CPUExecutionProvider"])
# inputs: image [1,3,H,W] (RGB, resized to the target size in inference.yml),
#         im_shape [1,2], scale_factor [1,2]
# output: [N, 6] -> class_id, score, x1, y1, x2, y2

License

Apache-2.0, same as the original PaddleOCR / PaddleX models. Original model and training by the PaddlePaddle team: https://github.com/PaddlePaddle/PaddleOCR.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for rizzoaiacademy/rizzo-ocr

Quantized
(1)
this model