Document Layout · Reading Order · 200×200 Instance Masks

PP-DocLayoutV3

PaddlePaddle's unified 25-class document layout analyzer (PaddlePaddle/PP-DocLayoutV3 via alex-dinh/PP-DocLayoutV3-ONNX, 130.50 MB fp32, Apache-2.0) running 100% locally in your browser on CPU WASM (onnxruntime-web@1.21.0). One forward pass emits bounding boxes, learned multi-column reading-order indices, and 200×200 binary instance masks.

On-device model

Why raw ONNX Runtime Web: Transformers.js has no pp_doclayout_v3 architecture class yet. This worker loads PP-DocLayoutV3_ir8.onnx directly in onnxruntime-web@1.21.0 CPU WASM with exact Resize(800, 800) RGB 0..1 (mean=[0,0,0], std=[1,1,1]) preprocessing, caches the 130.50 MB binary in Cache Storage under its exact Hugging Face URL for automatic reload, and disposes every tensor in try/finally.

Interactive Document Layout Inspector

Choose a verified document preset or drop/upload any scanned page, article screenshot, paper, or chart. Click any detected region on the canvas or in the reading-order list to inspect its 200×200 instance mask, polygon contour, and box geometry.

Initialise PP-DocLayoutV3 above to analyze document layout locally.

No page loaded yet Input: [1, 3, 800, 800] RGB 0..1

Telemetry & Reading Order

Regions —
ORT WASM —
NaN Check —
Classes —

Click any region on the document or list below to inspect its exact coordinates and mask fill.

    Model card & tensor contract

    Artifact & Size
    PP-DocLayoutV3_ir8.onnx · 130.50 MB (124.5 MiB, fp32)
    Task & License
    object-detection (25 layout classes + masks) · Apache-2.0
    Runtime & Backend
    onnxruntime-web@1.21.0 · CPU WASM (Web Worker)
    Exact ONNX input and output tensors verified live in Chrome
    Direction Tensor Name Shape & Type Semantics
    Input im_shape float32 [1, 2] Target network height and width: [800, 800]
    Input image float32 [1, 3, 800, 800] Resized RGB scaled 0..1 (mean=[0,0,0], std=[1,1,1]) NCHW
    Input scale_factor float32 [1, 2] [800 / origH, 800 / origW] so boxes return directly in original px
    Output fetch_name_0 float32 [300, 7] [class_id, score, xmin, ymin, xmax, ymax, read_order]
    Output fetch_name_1 int32 [1] Valid candidate row count (300)
    Output fetch_name_2 int32 [300, 200, 200] Binary {0, 1} full-page instance segmentation masks per row
    Show the code — Exact 800×800 RGB 0..1 preprocessing (rgbaToRgbZeroOneCHW)
    Show the code — Off-thread ORT 1.21.0 session execution & tensor disposal (runDetect)