How protei300/russiandocsocr works
RussianDocsOCR recognizes and validates Russian identity documents from a single image. The main workflow is upload through the REST service, queued background recognition, document-processing inference, and stored results presented in the web interface. The repository also documents Go, .NET, and Kotlin/JVM implementations intended to match the Python reference. Processing stages and service boundaries are grounded in the README and sampled source; some API-to-queue and UI wiring is documented rather than directly shown in the excerpts.
Main entry points: pipeline.py Recognition pipeline · worker.py Recognition worker · runtime.py ML runtime · documents.py REST API
Components 18
Web client
- Web interface
web/src/App.vue
REST service
- REST API
service/api/documents.py - Recognition worker
service/worker.py - ML runtime
service/ml/runtime.py - Result transform
service/ml/transform.py
Document processing
- Recognition pipeline
document_processing/pipeline/pipeline.py - Quality and fraud checks
document_processing/pipeline_modules - Document detection
document_processing/pipeline_modules/doc_detector/doc_detector.py - Page registration
document_processing/pipeline_modules/page_registration/page_registration.py - Field localization
document_processing/pipeline_modules/textfields_detector/textfields_detector.py - OCR and correction
document_processing/pipeline_modules/ocr_batch.py - MRZ validation
document_processing/validation/mrz.py - Cross-language ports
ports
Service state
- Document repositories
service/repositories/documents.py - File-backed store
service/core/database.py - Storage selection
service/core/storage_mode.py
Other components
- Operator
- Browser user
Connections 17
- Browser user → Web interface: uses
README.md - Operator → REST API: uploads image
README.md - Web interface → REST API: calls REST
README.md - REST API → Recognition worker: queues recognition
README.md - Recognition worker → ML runtime: runs recognition
service/worker.py - ML runtime → Recognition pipeline: invokes pipeline
- Recognition pipeline → Quality and fraud checks: checks quality
README.md - Recognition pipeline → Document detection: detects document
document_processing/pipeline/pipeline.py - Recognition pipeline → Page registration: registers page
README.md - Recognition pipeline → Field localization: localizes fields
README.md - Recognition pipeline → OCR and correction: recognizes text
README.md - Recognition pipeline → MRZ validation: validates MRZ
- ML runtime → Result transform: formats results
service/ml/runtime.py - Recognition worker → Document repositories: reads and writes
service/worker.py - Document repositories → File-backed store: persists records
- Storage selection → File-backed store: selects backend
service/core/storage_mode.py - Operator → Cross-language ports: can use alternatives
README.md