Menu

FastMRZ 3 - Passport MRZ Extraction in Pure Python, No Tesseract
📰

FastMRZ 3 - Passport MRZ Extraction in Pure Python, No Tesseract

DEV Community: computervision·Sivakumar Mahalingam·14 days ago
#E2NeY1xJ
Long article (1078 words) — no AI summary yet.
Reading 0:00
15s threshold

If you have ever built KYC onboarding, hotel check-in or border-control software, you know the MRZ: the two or three lines of <<< -padded text at the bottom of a passport, ID card or visa.

Reading it sounds simple. It is 37 possible characters (A-Z, 0-9 and < ) in a fixed layout defined by ICAO 9303. In practice, most Python MRZ tools come with the same setup ritual:

Install Tesseract at system level

Download a special MRZ traineddata file

Copy it into the correct tessdata folder

Make sure all of that also exists in your Docker image, Lambda layer, CI runner and the Windows laptop of whoever joins the team next

And after all that, it still struggles with phone photos that are skewed, blurred or badly lit.

The first versions of FastMRZ had the same problem, because they used Tesseract under the hood. With FastMRZ 3, I removed Tesseract completely.

What's new in FastMRZ 3

No Tesseract. FastMRZ now ships its own ONNX text recogniser, trained only for the MRZ character set.

Pure Python install.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.