← Models
Community models

DocAligner

Detect four document corners and prepare images for perspective correction.

Versions & downloads

Choose a fixed version. Downloads are free and do not require an account.

Apache-2.0

docaligner-1.1.1-fastvit-sa24-7f9f5a89

Free · commercial use permittedUsed by the current demo
fastvit_sa24_h_e_bifpn_256_fp32.onnx

ONNX · FP32 · 83.08 MB · 83,084,930 bytes

SHA-256
7f9f5a8935b2eb22b3ee0245d34996063f54562df390d34714af2d76928695bc
Download

Released under Apache-2.0. Keep the license and applicable notices when redistributing. Usage & licensing · LICENSE · SHA256SUMS

Run this version locally

Complete CPU examples, tested on Linux x86_64 with Python 3.12 for all six releases. The ONNX workflow also includes PowerShell commands; Windows execution has not been verified.

Downloaded ONNX files → JSON and overlay

In a new folder, run the steps below. They download this release’s files and a public mock-document image. The runner verifies every weight’s SHA-256 and then runs without network access. Replace input.jpg with your own image.

python -m venv .venv
source .venv/bin/activate
curl -fLO https://docsaid.org/examples/local-onnx.py
curl -fLO https://docsaid.org/examples/local-requirements.txt
curl -fLO https://docsaid.org/examples/model-manifest.json
curl -fLO https://docsaid.org/examples/local-NOTICE.txt
python -m pip install -r local-requirements.txt
mkdir -p weights
curl -fL https://docsaid.org/downloads/docaligner/7f9f5a8935b2eb22/fastvit_sa24_h_e_bifpn_256_fp32.onnx -o weights/fastvit_sa24_h_e_bifpn_256_fp32.onnx
curl -fL https://docsaid.org/samples/api/docaligner.jpg -o input.jpg
python local-onnx.py --release docaligner-1.1.1-fastvit-sa24-7f9f5a89 --weights-dir weights --image input.jpg --output result-onnx
local-onnx.py
Python package → JSON and overlay (Linux)

Debian-based Linux, Python 3.12: use a writable virtual environment and these pinned dependencies. The upstream package downloads a font on first import and missing weights on initialization, so initial setup needs internet access.

sudo apt-get update
sudo apt-get install -y python3-venv libgl1 libxcb1 libturbojpeg0 libglib2.0-0
python3 -m venv .venv-package
source .venv-package/bin/activate
curl -fLO https://docsaid.org/examples/package-example.py
curl -fLO https://docsaid.org/examples/package-requirements.txt
curl -fLO https://docsaid.org/examples/model-manifest.json
python -m pip install -r package-requirements.txt
curl -fL https://docsaid.org/samples/api/docaligner.jpg -o input.jpg
python package-example.py --release docaligner-1.1.1-fastvit-sa24-7f9f5a89 --image input.jpg --output result-package
package-example.py

Open result.json and overlay.png in the new output folder. DocAligner returns four pixel coordinates; MRZScanner returns text lines and, for Two-stage, the detected region. Compare them with the image before use. Choose a new output folder for each run.

Inputs: still JPEG/PNG/WebP, up to 10 MiB and 40 MP. EXIF orientation, white background for transparency, longest side capped at 1600 px, BGR tensors. These local examples use no center crop or document alignment; hosted preprocessing is documented separately.

Benchmarks

Published quality metrics

Jaccard Index measures document-region overlap on SmartDoc 2015. Higher is better; 1 is a perfect overlap.

DocAligner · Original evaluation results
VariantParametersGFLOPsSmartDoc 2015 · JI ↑
FastViT SA2420.8 M8.50.9937
FastViT T83.3 M1.70.9906
LC1001.2 M1.60.9892
PReg LC0501.1 M0.220.9596

Historical upstream evaluations for variants with verified downloads. Evaluation method & source

Complete request timing

Small sequential measurement using public sample images, with no competing requests. HTTP time includes the test client’s upload, web proxy, API checks, worker decode/preprocessing/inference/postprocessing and response transfer. This isolated local route excludes the public internet, Cloudflare and production traffic; use it as a reproducible integration measurement. See the raw file for versions, input hashes, machine and all samples.

13th Gen Intel(R) Core(TM) i9-13900K · 2 CPU · 2 GiB · n=5 · 900 × 1600 px

docaligner-1.1.1-fastvit-sa24-7f9f5a89

ModelHTTP p50 (ms)HTTP min–max (ms)
DocAligner103.8184.19–117.11

Nov 16, 2026 UTC · Measurement record (JSON) · Retries and errors

File size & inference baseline

File sizes come from the offered downloads. Timings measure each ONNX file separately.

ONNX forward pass · batch 1
Weight fileInput tensor (NCHW)Download sizep50 (ms)p95 (ms)
lcnet100heatmap_reg1 × 3 × 256 × 2564.77 MB19.0420.56
fastvit_t8heatmap_reg1 × 3 × 256 × 25613.17 MB12.5813.17
fastvit_sa24heatmap_reg1 × 3 × 256 × 25683.08 MB44.0746.1
lcnet050point_reg1 × 3 × 256 × 2564.91 MB1.061.09

Measurement conditions

13th Gen Intel(R) Core(TM) i9-13900K · ONNX Runtime 1.22.0 · CPU · FP32 · batch 1 · 2 inference threads

Shared host, limited to 2 CPUs. Zero-filled FP32 inputs; 5 warm-up runs and 20 sequential measured runs. Measures model execution only; excludes loading, preprocessing, postprocessing and network.

Oct 9, 2026 UTC · Measurement record (JSON)

Usage & licensing

The released Community code and official model weights are free to use, including in commercial products. Training datasets retain their original providers’ terms.