ProjectApplied AI · 2026
Document OCR
Local-first OCR for passports and Indian KYC documents, on RapidOCR and PP-OCRv5. Packaged for Python, HTTP, Docker and Node.js. No image leaves your network.
- Python
- TypeScript
- FastAPI
- RapidOCR
- PP-OCRv5
- OpenCV
- Docker
Applied AI · Project
Overview
Document OCR is a privacy-conscious extraction pipeline for passports and Indian identity documents. It preprocesses scans, identifies the document type, runs targeted OCR, validates identifiers, and returns structured fields through Python, HTTP, or a Node.js wrapper.
What It Handles
The pipeline supports passport biodata and back pages, PAN cards, Aadhaar cards, driving licences, and voter IDs. Each document type has a dedicated extractor instead of relying on one generic prompt or parsing pass.
A Local-First Architecture
The default Python and npm-local modes keep document processing on the operator's machine. The Node.js package manages the Python environment and server lifecycle automatically, while Docker, Cloud Run, and Lambda targets are available for controlled deployments.
Extraction Pipeline
- Correct orientation, detect document boundaries, and improve scan quality.
- Classify the document and page type.
- Run PP-OCRv5 through RapidOCR with document-specific regions and fallbacks.
- Parse structured fields and cross-check them against known formats.
- Return confidence, warnings, validation results, and processing time.
Validation, Not Verification
Passport MRZ fields use ICAO check digits, Aadhaar numbers use the Verhoeff checksum, and PAN, driving-licence, and voter-ID identifiers are format-validated. These checks improve extraction quality, but they do not prove identity or document authenticity.
Developer Experience
The same core pipeline ships as a Python package, a FastAPI service, a Docker image, and an npm wrapper. Health and readiness endpoints make model warm-up explicit, and the public API uses one typed result shape across every deployment mode.
Privacy Boundaries
The project contains no identity-document fixtures or personal data. Internet-facing deployments require authentication, authorization, encrypted transport, rate limits, and a deliberate retention policy.
Next projectDeveloper Tools