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.
docaligner-1.1.1-fastvit-sa24-7f9f5a89
ONNX · FP32 · 83.08 MB · 83,084,930 bytes
SHA-256
7f9f5a8935b2eb22b3ee0245d34996063f54562df390d34714af2d76928695bcReleased 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-onnxlocal-onnx.pyPython 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-packagepackage-example.pyOpen 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.
| Variant | Parameters | GFLOPs | SmartDoc 2015 · JI ↑ |
|---|---|---|---|
| FastViT SA24 | 20.8 M | 8.5 | 0.9937 |
| FastViT T8 | 3.3 M | 1.7 | 0.9906 |
| LC100 | 1.2 M | 1.6 | 0.9892 |
| PReg LC050 | 1.1 M | 0.22 | 0.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
| Model | HTTP p50 (ms) | HTTP min–max (ms) |
|---|---|---|
| DocAligner | 103.81 | 84.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.
| Weight file | Input tensor (NCHW) | Download size | p50 (ms) | p95 (ms) |
|---|---|---|---|---|
lcnet100heatmap_reg | 1 × 3 × 256 × 256 | 4.77 MB | 19.04 | 20.56 |
fastvit_t8heatmap_reg | 1 × 3 × 256 × 256 | 13.17 MB | 12.58 | 13.17 |
fastvit_sa24heatmap_reg | 1 × 3 × 256 × 256 | 83.08 MB | 44.07 | 46.1 |
lcnet050point_reg | 1 × 3 × 256 × 256 | 4.91 MB | 1.06 | 1.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.