Instructions to use PaddlePaddle/PP-DocLayoutV3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PaddleOCR
How to use PaddlePaddle/PP-DocLayoutV3 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") 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
PP-DocLayoutV3 ONNX Version
Great work!
Hi @alex-dinh , how did you convert the model to onnx. Using paddlex --paddle2onnx fails. Did you have to modify any operator?
Thanks!
I detailed how to do the conversion in this PR here: https://github.com/PaddlePaddle/Paddle2ONNX/pull/1619
Hi, does your version enable batching? Currently, I can't batch on the native version because the authors hardcoded batch=1 as a literal integer in the torch source's attention/decoder
reshapes, and torch.onnx.export bakes those literals into frozen graph constants.
Hi @xDido , yes batching is supported. Here is an example python script for batched inference: https://huggingface.co/alex-dinh/PP-DocLayoutV3-ONNX/blob/main/batched_inference_example.py