image-to-text · vision · PP-LCNet_x1_0 · onnxruntime-web@1.21.0 WASM · fp32 · 6.8 MB · Apache-2.0

PP-LCNet_x1_0 Document Orientation & Auto-Deskew

Classify sideways or upside-down document scans across four cardinal orientations (0°, 90°, 180°, 270°) and straighten them using PaddlePaddle/PP-LCNet_x1_0_doc_ori_onnx (image-to-text, Apache-2.0, 6.8 MB fp32 across inference.onnx 6.79 MB + inference.yml) running 100% locally on CPU WASM via onnxruntime-web@1.21.0 — zero cloud uploads, zero EXIF heuristics.

PaddlePaddle/PP-LCNet_x1_0_doc_ori_onnx image-to-text WASM · fp32 · 6.8 MB x [1,3,224,224] → fetch_name_0 [1,4] Apache-2.0

Before / After Auto-Deskew Split View

Input Scan (Raw)

Loading…

Auto-Deskewed Output

Awaiting inference

Rendering starter document scan…

Live 4-Angle Softmax Probability Distribution

Deskew formula: correctionCW = (360 − predictedAngle) mod 360

See inside PP-LCNet_x1_0_doc_ori

Exact 224×224 Center-Crop Model Input

PreProcess: resize_short=256 → 224×224 center crop → BGR ImageNet norm → x [1, 3, 224, 224]

At a glance — verified ONNX runtime contract

Repository
PaddlePaddle/PP-LCNet_x1_0_doc_ori_onnx (Apache-2.0)
Task & Accuracy
image-to-text (4-class document orientation · 99.06% model card accuracy)
Weights
inference.onnx (6,788,069 B, fp32) + inference.yml (766 B) = 6.8 MB
Input Tensor
x [1, 3, 224, 224] float32 BGR · mean [0.485, 0.456, 0.406], std [0.229, 0.224, 0.225]
Output Tensor
fetch_name_0 [1, 4] normalized probabilities for 0° / 90° / 180° / 270°
Runtime
onnxruntime-web@1.21.0 CPU WASM EP (isolated Web Worker, zero WebGPU required)
Baseline APIs
WebAssembly, Web Workers, OffscreenCanvas, Canvas 2D, Cache Storage

Why local document orientation matters

Show the code — PaddleX BGR ImageNet float32 CHW normalization (rgbaToBgrImageNetCHW)
Show the code — Off-main-thread onnxruntime-web@1.21.0 inference & tensor disposal (classifyOrientation)

Explore the PP-LCNet Document Orientation ladder