MRZScanner
Locate and read machine-readable zones on identity documents.
Version selection evidence
A reproducible check on five existing MIDV-2020 mock-passport photos: TD3 only, AZE ×1, GRC ×2, LVA ×1, SRB ×1; 10 labelled lines and 440 characters. Both downloadable versions used the same local ONNX workflow and inputs.
| Variant | Exact documents | Exact lines | CER ↓ | ANLS ↑ |
|---|---|---|---|---|
| Two-stage · 20250222 / 20250221 | 2/5 | 5/10 | 49.3% | 0.595 |
| Spotting · 20240919 | 0/5 | 0/10 | 24.5% | 0.657 |
CER counts insertions, deletions and substitutions against 440 reference characters. ANLS averages normalized edit similarity per line, scoring similarities of 0.5 or less as zero. Exact matches require every character, including fillers, to match.
Start integration with Two-stage, the hosted version: it produced two exact documents in this sample. Spotting had lower character error but no exact document. For version selection, label examples from your own workflow and compare both; manually verify identity fields before use.
Sample limits and postprocessing
These are five non-random demo photos with one visual label reviewer; training overlap is unknown. TD1/TD2, visas, heavy rotation, occlusion and adversarial images were not tested. This is a local workflow check. Production accuracy and hosted quality need separate, representative evaluation.
Format substitutions left exact-document counts unchanged (2/5 and 0/5). Two-stage character edits changed from 217 to 218; Spotting stayed at 108. Two-stage also returned a three-line layout for two TD3 inputs. Format validity alone checks line structure; check digits were not verified.
Versions & downloads
Choose a fixed version. Downloads are free and do not require an account.
mrzscanner-1.0.7-det20250222-rec20250221
ONNX · FP32 · 29.95 MB · 29,949,153 bytes
SHA-256
0786844728d828dc68c19b844aa87e2b29fdba3a587468f2863824d116ffc269ONNX · FP32 · 40.58 MB · 40,578,848 bytes
SHA-256
07cef987fc1852aac12f18e1269fbaf1e2644579ca5743061d6f9cec7bef77c0Released 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/mrzscanner/0786844728d828dc/mrz_detection_20250222_fp32.onnx -o weights/mrz_detection_20250222_fp32.onnx
curl -fL https://docsaid.org/downloads/mrzscanner/07cef987fc1852aa/mrz_recognition_20250221_fp32.onnx -o weights/mrz_recognition_20250221_fp32.onnx
curl -fL https://docsaid.org/samples/api/mrzscanner.jpg -o input.jpg
python local-onnx.py --release mrzscanner-1.0.7-det20250222-rec20250221 --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/mrzscanner.jpg -o input.jpg
python package-example.py --release mrzscanner-1.0.7-det20250222-rec20250221 --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
The original documentation defines ANLS and exact-match accuracy. Reproducible per-version scores are unpublished.
| Variant | Parameters | GFLOPs | ANLS / Accuracy ↑ |
|---|---|---|---|
| Two-stage · 20250222 / 20250221 | — | — | Not published |
| Spotting · 20240919 | — | — | Not published |
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
mrzscanner-1.0.7-det20250222-rec20250221
| Model | HTTP p50 (ms) | HTTP min–max (ms) |
|---|---|---|
| MRZScanner | 409.77 | 391.13–422.37 |
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) |
|---|---|---|---|---|
20250222det | 1 × 3 × 256 × 256 | 29.95 MB | 52.49 | 55.03 |
20250221rec | 1 × 3 × 64 × 640 | 40.58 MB | 277.87 | 291.14 |
20240919spotting | 1 × 3 × 512 × 512 | 33.87 MB | 84.92 | 88.8 |
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.