PP-DocLayoutV4 ONNX model and model card
Browse filesFiles changed (2)
- PP-DocLayoutV4.onnxAdded+3
- README.mdAdded+53
123version https://git-lfs.github.com/spec/v1oid sha256:800db25f046af9395f7acde36c51a93fe2fce8019cfbb1bacb5a663d83a4c233size 1531117751234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253---license: otherlicense_name: pp-doclayoutv4license_link: https://github.com/omnidocai/PP-DocLayoutV4/blob/main/NOTICElibrary_name: onnxpipeline_tag: object-detectiontags: - document-layout-analysis - reading-order - onnx - openvino - paddlepaddle - pp-doclayoutv4---
# PP-DocLayoutV4 (ONNX and Paddle)
Document layout analysis with **PP-DocLayoutV4**: 25 layout classes, a four-point box per region and the reading orderof the page. Code (Python on ONNX Runtime, OpenVINO or PaddlePaddle; Rust on ONNX Runtime), results and paper:**[github.com/omnidocai/PP-DocLayoutV4](https://github.com/omnidocai/PP-DocLayoutV4)** 路 [omnidoc.top](https://omnidoc.top)
| file | what | bytes | SHA-256 ||---|---|---|---|| `PP-DocLayoutV4.onnx` | the official inference graph exported to ONNX (opset 17, FP32) for ONNX Runtime and OpenVINO: CPUs from Intel and AMD, NVIDIA, AMD and Intel GPUs, Intel NPUs | 153,111,775 | `800db25f046af9395f7acde36c51a93fe2fce8019cfbb1bacb5a663d83a4c233` || `PP-DocLayoutV4_infer/inference.json` | the official Paddle inference model (PaddlePaddle 3): graph | 1,272,437 | `ab841469f943b754d4e93d43bf90899274d266b1f28e439197bc7199dd146d07` || `PP-DocLayoutV4_infer/inference.pdiparams` | weights | 132,771,206 | `7d6057d36b99d2f8f8df39e173f10efd5eff512196620c7912b8d29172bc4f88` || `PP-DocLayoutV4_infer/inference.yml` | pre-processing and labels | 1,482 | `12073ce49d0f7c96fc5ad5ebda2098267913b6b4a21fe453a9085765034ee408` |
## Use
```bashgit clone https://github.com/omnidocai/PP-DocLayoutV4 && cd PP-DocLayoutV4python download_model.py all # these files, SHA-256 checked (HF_ENDPOINT for a mirror)bash run.sh page.png scans/ paper.pdf -o out --vis # ONNX Runtime, CPUV4_RUNTIME=paddle-gpu bash run.sh scans/ -o out --device paddle:gpu # the Paddle model, NVIDIA GPU```
Each page gives a JSON with the regions in reading order: class, score, box and four-point box. Rust:`cd rust && cargo build --release && target/release/pp-doclayoutv4 page.png -o out --model ../PP-DocLayoutV4.onnx`.
## Results
On 470 public pages, ONNX Runtime on an Intel CPU and an NVIDIA GPU and OpenVINO on the CPU return the regions ofofficial Paddle inference (9,845 regions: none lost, added or reclassified, reading order unchanged); on the 110annotated pages of PaddleX's own layout demo dataset every runtime scores what official Paddle scores (mAP 36.18 atIoU 0.50:0.95). Details, speed and the paper: see the GitHub repository.
## License
PP-DocLayoutV4 is a model by the PaddlePaddle team; these files are its official inference model and an ONNX export ofit, redistributed by OmniDoc and subject to the PaddlePaddle team's terms for the model. The ONNX file is the officialinference graph exported with paddle2onnx, with added operators that leave every output unchanged (checked bit for bitwith ONNX Runtime CPU, OpenVINO CPU and ONNX Runtime CUDA). The code on GitHub is Apache-2.0.PP-DocLayoutV4.onnxAdded+3
README.mdAdded+53