afis
AFIS toolkit for fingerprint minutiae extraction, matching, and quality assessment. Classical extractors (NBIS/MINDTCT, Gabor, STFT, SAFIS) plus optional LEADER ONNX.
Install
pip install afis
# or
uv add afis
# Optional: LEADER deep minutiae extractor
pip install 'afis[leader]'
From source (includes the optional native NBIS library):
make install # uv sync + make native
Quickstart
from afis import NbisExtractor, MindtctExtractor, SafisExtractor, compute_nfiq2
# NIST NBIS (native) — requires make native
nbis = NbisExtractor()
a = nbis.extract_minutiae("finger_a.png")
b = nbis.extract_minutiae("finger_b.png")
print(a.n_minutiae, a.header.image_quality)
print(nbis.match(a, b))
# Pure-Python NBIS-compatible (no native lib)
py = MindtctExtractor()
t = py.extract_minutiae("finger_a.png")
# SourceAFIS-equivalent edge matching (not Bozorth3)
safis = SafisExtractor()
s = safis.extract_minutiae("finger_a.png")
print(safis.match(s, s))
# LEADER ONNX (requires: pip install 'afis[leader]')
from afis import LeaderExtractor
leader = LeaderExtractor()
lt = leader.extract_minutiae("finger_a.png")
print(lt.n_minutiae, leader.match(lt, lt))
# Quality only (NFIQ2, 0–100)
q = compute_nfiq2(image)
print(q.score)
Choose a stack
| Class | Extract | Match | When to use |
|---|---|---|---|
NbisExtractor |
nbis_mindtct |
nbis_bozorth3 |
NIST NBIS parity, production with native lib |
MindtctExtractor |
mindtct |
bozorth3 |
Same NBIS flow, pure Python / portable |
SafisExtractor |
safis |
safis |
SourceAFIS-style edge pairing |
LeaderExtractor |
leader |
mcc |
LEADER ONNX minutiae; needs afis[leader] |
Mix and match freely:
from afis import NbisExtractor
# Classical Gabor enhance + MCC matching
proc = NbisExtractor(extractor="gabor", matcher="mcc")
# STFT enhance + geometric matcher
proc = NbisExtractor(extractor="stft", matcher="geometric")
# LEADER extract + Bozorth3 match
proc = NbisExtractor(extractor="leader", matcher="bozorth3")
Extractors
| Name | Kind | Notes |
|---|---|---|
nbis_mindtct |
Native NBIS MINDTCT / LFS V2 | Closest to NIST tooling; needs libafis_lfs |
mindtct |
Pure-Python MINDTCT | NBIS-compatible without native lib |
safis |
SourceAFIS path | Minutiae for SAFIS edge matching |
gabor |
Classical enhance + CN | Hong/Wan/Jain-style Gabor; good default research path |
stft |
STFT enhance + CN | Often stronger on noisy / low-contrast prints |
leader |
LEADER ONNX (pyfing) | Fully convolutional; optional onnxruntime extra |
Matchers
| Name | Kind | Notes |
|---|---|---|
nbis_bozorth3 |
Native Bozorth3 | NIST score scale; needs height (+ width optional) |
bozorth3 |
Pure-Python Bozorth3 | Same idea, no native lib |
safis |
SourceAFIS edge crawl | Raw threshold ≈ 40; not Bozorth3 |
mcc |
Minutia Cylinder-Code | Strong classical matcher; good with gabor/stft/leader |
geometric |
Rigid hypothesis | Simple baseline / debugging |
Quality (NFIQ2)
compute_nfiq2(image) and every extractor report return a unified 0–100 score (ISO/IEC 29794-4 / NFIQ 2 style),
with actionable feedback when available.
from afis import compute_nfiq2
r = compute_nfiq2(image)
print(r.score, r.actionable)
Use cases
| Goal | Suggested setup |
|---|---|
| Drop-in NBIS / agency tooling | NbisExtractor() |
| Portable NBIS without C lib | MindtctExtractor() |
| SourceAFIS-like verification | SafisExtractor() |
| Deep minutiae (LEADER ONNX) | LeaderExtractor() / afis[leader] |
| Preferred classical matcher | matcher="mcc" (post frame-fix); native NBIS still fastest |
| Fast geometric sanity check | matcher="geometric" |
| Enrollment quality gate | compute_nfiq2 / template.header.image_quality |
| ISO template interchange | template.to_iso19794_2() / .xyt |
CLI
afis extract finger.png finger.xyt
afis extract finger.png out.xyt --extractor mindtct
afis extract finger.png out.xyt --extractor leader
afis match a.xyt b.xyt --method bozorth3 --height 480
afis match a.xyt b.xyt --method safis
afis match a.xyt b.xyt --method mcc
afis quality finger.png
Develop
make install
make test
make build
References
- NIST NBIS — MINDTCT / LFS V2 / Bozorth3. NIST Biometric Image Software
- NFIQ 2 / ISO/IEC 29794-4 — Finger image quality. usnistgov/NFIQ2
- SourceAFIS — Edge-pairing matcher algorithm (Važan). algorithm
- MCC — Cappelli, Ferrara & Maltoni (2010). Minutia Cylinder-Code. IEEE TPAMI. https://doi.org/10.1109/TPAMI.2010.52
- LEADER — Fully convolutional minutiae detector (pyfing). pyfing
- Gabor enhancement — Hong, Wan & Jain (1998). Fingerprint image enhancement. IEEE TPAMI
- ISO/IEC 19794-2 — Finger minutiae data interchange
- FVC / FVC-onGoing — Verification benchmarks (EER, FMR, FNMR)
License
MIT. Copyright (c) 2026 Ashok Pant.
Metadata
Release files for afis 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| afis-1.2.0.tar.gz | 4.9 MB | With provenance | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| afis-1.2.0-py3-none-manylinux_2_38_x86_64.whl | Python 3 | none | Linux glibc 2.38+ x86-64 | Details |
| afis-1.2.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 13.6 MB
Release files / afis-1.2.0.tar.gz
| Download URL | afis-1.2.0.tar.gz |
|---|---|
| Size | 4.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8f3d773217da8c7e5d11d8b265cf0e41fa45a4d3e05ed5294de89f92827b05d
|
|
BLAKE2b-256 checksum How to use checksums |
e419128771cb0270ddda0b505dde10dd7de1694fbaeabe4937b3da3e6fd3412a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logRelease files / afis-1.2.0-py3-none-manylinux_2_38_x86_64.whl
| Download URL | afis-1.2.0-py3-none-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | Linux glibc 2.38+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
9e3e786dc4eb1e16f5853a2330806df7915959002c5eae3fd57960782d83e911
|
|
BLAKE2b-256 checksum How to use checksums |
a51ff17c802b98b0a119915dd5571db4a31af46c79d8c2ed62ee41b7bdbecb93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logRelease files / afis-1.2.0-py3-none-macosx_11_0_arm64.whl
| Download URL | afis-1.2.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ff2cc2f4d89eb81a0558123653bb318994fa1e1e9b3d7d3706e13c987b07caa2
|
|
BLAKE2b-256 checksum How to use checksums |
9d7a54a1df8f4b2a5ec39c09653c8782ec9ef25903fe4c8f8e1b75d78b80ec65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logSecurity for afis 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 3 files in this release have been uploaded with provenance metadata.
Attestation for afis-1.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.