DocAligner
偵測文件四個角點,為影像透視校正提供座標。
版本與下載
選擇固定版本。下載免費,不需要帳號。
docaligner-1.1.1-fastvit-sa24-7f9f5a89
ONNX · FP32 · 83.08 MB · 83,084,930 位元組
SHA-256
7f9f5a8935b2eb22b3ee0245d34996063f54562df390d34714af2d76928695bc依 Apache-2.0 發布;再散布時請保留授權與適用聲明。 使用與授權 · LICENSE · SHA256SUMS
在本機執行此版本
完整 CPU 範例,六個版本皆已在 Linux x86_64、Python 3.12 實跑。ONNX 流程另附 PowerShell 指令;Windows 執行尚未驗證。
下載 ONNX → JSON 與標註圖
在新資料夾依序執行以下指令,下載此版本檔案與公開模擬證件圖。程式會核對每個權重的 SHA-256,之後推論無須網路。使用自己的圖片時替換 input.jpg。
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 套件 → JSON 與標註圖(Linux)
適用 Debian 系 Linux、Python 3.12:使用可寫入的虛擬環境與固定依賴版本。上游套件首次匯入會下載字型,初始化會下載缺少的權重,因此首次設定需要網路。
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.py打開新輸出資料夾中的 result.json 與 overlay.png。DocAligner 回傳四個像素座標;MRZScanner 回傳文字行,Two-stage 另有偵測區域。使用前對照原圖檢查,每次執行指定新的輸出資料夾。
輸入為靜態 JPEG/PNG/WebP,上限 10 MiB、4,000 萬像素。套用 EXIF 方向、透明背景合成白色,長邊縮至最多 1600 px,轉為 BGR 張量。本機範例不做中心裁切或文件對齊;代管服務的前處理另見 API 文件。
評測結果
已發布的品質指標
Jaccard Index 衡量 SmartDoc 2015 上的文件區域重疊程度,越高越好;1 代表完全重疊。
| 模型變體 | 參數量 | 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 |
上游既有評測,僅列出已核對下載檔案的變體。 評測方法與來源
完整請求耗時
以公開範例圖逐筆量測,沒有競爭請求。HTTP 時間包含測試 client 上傳、Web 代理、API 檢查、worker 解碼/前處理/推論/後處理及回應傳輸。此隔離本機路徑未涵蓋公網、Cloudflare 與正式流量,可用於重現整合流程;版本、輸入雜湊、機器與各次樣本見原始資料。
13th Gen Intel(R) Core(TM) i9-13900K · 2 CPU · 2 GiB · n=5 · 900 × 1600 px
docaligner-1.1.1-fastvit-sa24-7f9f5a89
| 模型 | HTTP p50 (ms) | HTTP min–max (ms) |
|---|---|---|
| DocAligner | 103.81 | 84.19–117.11 |
2026年11月16日 UTC · 量測記錄 (JSON) · 重試與錯誤
檔案大小與推論速度基準
檔案大小取自實際下載檔案,時間為各 ONNX 檔案的個別量測。
| 權重檔案 | 輸入張量 (NCHW) | 下載大小 | 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 |
量測條件
13th Gen Intel(R) Core(TM) i9-13900K · ONNX Runtime 1.22.0 · CPU · FP32 · batch 1 · 2 個推論執行緒
共用主機,限制 2 CPU。使用全零 FP32 輸入,預熱 5 次後依序量測 20 次。僅量測模型執行,排除載入、前後處理與網路。
2026年10月9日 UTC · 量測記錄 (JSON)
使用與授權
已釋出的開源程式與官方模型權重可免費使用,包括商業產品。訓練資料集仍依原提供者的條款使用。