Object Detection
Transformers
ONNX
PaddleOCR
English
Chinese
multilingual
PaddlePaddle
image-segmentation
ocr
layout
layout_detection
Instructions to use PaddlePaddle/PP-DocLayoutV3_onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PaddlePaddle/PP-DocLayoutV3_onnx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("object-detection", model="PaddlePaddle/PP-DocLayoutV3_onnx")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("PaddlePaddle/PP-DocLayoutV3_onnx", device_map="auto") - PaddleOCR
How to use PaddlePaddle/PP-DocLayoutV3_onnx with PaddleOCR:
# 1. See https://www.paddlepaddle.org.cn/en/install to install paddlepaddle # 2. pip install paddleocr from paddleocr import LayoutDetection model = LayoutDetection(model_name="PP-DocLayoutV3_onnx") output = model.predict(input="path/to/image.png", batch_size=1) for res in output: res.print() res.save_to_img(save_path="./output/") res.save_to_json(save_path="./output/res.json") - Notebooks
- Google Colab
- Kaggle
Correct ONNX model library metadata to PaddleOCR
#1
by ChengCui - opened
This ONNX repository declares library_name: transformers, while its documented loading path uses PaddleOCR with ONNX Runtime. It contains inference.onnx and inference.yml rather than a Transformers model package.
Change library_name to PaddleOCR so the Hub uses the matching library integration and download-counting rule, which explicitly includes the root inference.onnx file. All other metadata and model card content are preserved.
References:
- https://huggingface.co/docs/hub/model-cards#specifying-a-library
- https://huggingface.co/docs/hub/models-download-stats
- https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/model-libraries.ts
This PR is left open for maintainer review.