Before / After Auto-Deskew Split View
Input Scan (Raw)
Loading…Auto-Deskewed Output
Awaiting inferenceRendering 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 for0° / 90° / 180° / 270°- Runtime
onnxruntime-web@1.21.0CPU WASM EP (isolated Web Worker, zero WebGPU required)- Baseline APIs
- WebAssembly, Web Workers, OffscreenCanvas, Canvas 2D, Cache Storage
Why local document orientation matters
- Fix OCR collapse before it starts Standard text detectors and CTC recognizers degrade sharply on 90°-sideways or 180°-inverted scans. A 6.8 MB pre-pass straightens pages in ~12 ms on CPU.
- Zero-EXIF & screenshot-safe Scanner exports, stripped PDFs, and mobile screenshots drop EXIF orientation tags. PP-LCNet reads visual typography cues directly instead of trusting metadata.
- Private intake for receipts & contracts Financial invoices, medical forms, and lab sheets never leave the visitor's browser tab — ready for offline multi-page intake queues.
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
Basics · 4-Quadrant Wheel & Round-Trip
Spin any scan across 0°/90°/180°/270°, prove round-trip deskew re-classifies to 0°, and ablate center vs corner vs stretched crops.
Practical · Multi-Page Batch Scan Fixer
Straighten a multi-page queue offline with Pause, Resume, and Cancel, confidence gating, deskewed ZIP/PNG downloads, and OWASP-safe CSV/JSON audit manifests.
Wild · 5-Perturbation Stress Suite
Stress-test accuracy and top-1/top-2 flip margin across Heavy Crop, Gaussian Blur, Low Contrast, Scanner Border Noise, and 1.8× Aspect Stretch.
Multi-model · PP-LCNet → PP-OCRv5 Mobile
Chain PP-LCNet auto-deskew (6.8 MB) with reused PP-OCRv5 Mobile (21.5 MB) to compare raw 90°/180° OCR failure against clean deskewed text extraction.