Logo Lanfrica

Jesuph-jobs/ocr-id-service

Domain:

digital infrastructure

Record type:

software
Creator:
Jes
Host:
Self-hosted CPU-only OCR worker for Algerian identity documents using PaddleOCR, OpenCV, and BullMQ-compatible Redis. # OCR ID Service Self-hosted, CPU-only OCR worker for extracting structured identity data from document images. The project is open source and currently optimized for Algerian national identity cards (CNI), including French/Latin and Arabic text. It uses PaddleOCR, OpenCV, Pydantic, and BullMQ-compatible Redis queues, with no cloud API, paid service, or GPU requirement. ## Current scope Algerian CNI is the supported and tested document type. The classifier has experimental hooks for passports and driving licenses, but those formats are not yet guaranteed and should be treated as `unknown` or reviewed manually when confidence is low. The extractor is intentionally modular: additional document formats can be added with new language patterns, preprocessing profiles, and field extractors. This project performs image OCR and heuristic document classification. It does not verify government records, read NFC/chips, prove biometric authenticity, perform face matching, or replace a KYC/identity provider. OCR results must be reviewed and validated against an authoritative record before making an identity decision. ## Architecture A TypeScript or NestJS producer adds a `scan-id` job to the `algerian-id-ocr` BullMQ queue. The Python worker consumes it, scans the image, and stores the structured result as BullMQ's job `returnvalue`. Producers can listen with `QueueEvents` or inspect the job state and return value. Jobs accept `{ "image_path": "card.jpg" }` for a shared mounted directory or `{ "image_base64": "..." }` when the image must cross a host boundary. The Python worker uses the official BullMQ Python library and the same Redis/Lua queue contract as the Node.js BullMQ package. No HTTP server is required; this makes it suitable as a standalone worker behind an existing backend. ## Requirements - Python 3.11–3.13 - uv - Redis reachable through `REDIS_URL` - CPU-only runtime; PaddlePaddle is installed with its CPU package ## Local development ```bash cp .env.examp …