← Models
Community models

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.

Local raw recognition · 5 documents
VariantExact documentsExact linesCER ↓ANLS ↑
Two-stage · 20250222 / 202502212/55/1049.3%0.595
Spotting · 202409190/50/1024.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.

Apache-2.0

mrzscanner-1.0.7-det20250222-rec20250221

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

ONNX · FP32 · 29.95 MB · 29,949,153 bytes

SHA-256
0786844728d828dc68c19b844aa87e2b29fdba3a587468f2863824d116ffc269
Download
mrz_recognition_20250221_fp32.onnx

ONNX · FP32 · 40.58 MB · 40,578,848 bytes

SHA-256
07cef987fc1852aac12f18e1269fbaf1e2644579ca5743061d6f9cec7bef77c0
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/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-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/mrzscanner.jpg -o input.jpg
python package-example.py --release mrzscanner-1.0.7-det20250222-rec20250221 --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

The original documentation defines ANLS and exact-match accuracy. Reproducible per-version scores are unpublished.

MRZScanner · Original evaluation results
VariantParametersGFLOPsANLS / 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

ModelHTTP p50 (ms)HTTP min–max (ms)
MRZScanner409.77391.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.

ONNX forward pass · batch 1
Weight fileInput tensor (NCHW)Download sizep50 (ms)p95 (ms)
20250222det1 × 3 × 256 × 25629.95 MB52.4955.03
20250221rec1 × 3 × 64 × 64040.58 MB277.87291.14
20240919spotting1 × 3 × 512 × 51233.87 MB84.9288.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.