How anujgoyal239/ocr_model_idfc_bank works
This repository implements invoice/document OCR and structured field extraction, with a Streamlit interface for uploading, processing, reviewing, and exporting results. The principal workflow runs from upload validation through the frontend processing service into the document pipeline, which preprocesses documents, performs OCR, extracts fields, and returns results for display and history. Source-index references support the pipeline’s main dependencies; unsampled evaluation and some UI behavior are represented only where the tree and references establish a distinct capability.
Main entry points: src/main.py Pipeline orchestrator · streamlit_frontend/main.py Streamlit app · hybrid_ocr_engine.py Hybrid OCR · processor.py Processing service
Components 28
User interface
- Streamlit app
streamlit_frontend/main.py - Upload validation
streamlit_frontend/components/upload.py - Results and history
streamlit_frontend/components - Export results
streamlit_frontend/components/export.py - Cache and history
streamlit_frontend/services - Processing service
streamlit_frontend/services/processor.py - Flask backend
streamlit_frontend/backend_server_flask.py
Document pipeline
- Pipeline orchestrator
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Document preprocessing
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/preprocessing/preprocessor.py - PDF conversion
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/preprocessing/pdf_converter.py - Image enhancement
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/preprocessing/image_enhancer.py
OCR and vision
- Hybrid OCR
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/hybrid_ocr_engine.py - PaddleOCR engine
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/paddle_ocr_engine.py - Tesseract engine
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/tesseract_ocr_engine.py - OCR result model
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/ocr_result.py - Stamp and signature detection
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/vision/vision_detector.py
Field extraction
- Field extraction
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/field_extractor.py - Dealer extraction
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/dealer_name_extractor.py - Model extraction
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/unified_model_extractor.py - Horsepower extraction
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/horse_power_extractor.py - Asset cost extraction
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/asset_cost_extractor.py - Field optimizers
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction - Fuzzy matching
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/fuzzy_matcher.py
Quality and support
- Confidence scoring
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/confidence/confidence_scorer.py - Evaluation metrics
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/evaluation - Gemini fallback
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/utils/gemini_fallback.py - Cost tracking
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/utils/cost_tracker.py
Other components
- Document user
Connections 29
- Document user → Upload validation: submits document
- Streamlit app → Upload validation: renders
streamlit_frontend/main.py - Streamlit app → Processing service: requests processing
streamlit_frontend/main.py - Streamlit app → Cache and history: checks and records
streamlit_frontend/main.py - Streamlit app → Results and history: renders results
streamlit_frontend/main.py - Streamlit app → Export results: renders export
streamlit_frontend/main.py - Processing service → Flask backend: posts document
streamlit_frontend/services/processor.py - Processing service → Pipeline orchestrator: processes locally
streamlit_frontend/services/processor.py - Flask backend → Pipeline orchestrator: invokes pipeline
streamlit_frontend/backend_server_flask.py - Pipeline orchestrator → Document preprocessing: preprocesses document
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Document preprocessing → PDF conversion: converts PDFs
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/preprocessing/preprocessor.py - Document preprocessing → Image enhancement: enhances images
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/preprocessing/preprocessor.py - Pipeline orchestrator → Hybrid OCR: recognizes text
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Hybrid OCR → PaddleOCR engine: dispatches OCR
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/hybrid_ocr_engine.py - Hybrid OCR → Tesseract engine: dispatches OCR
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/hybrid_ocr_engine.py - PaddleOCR engine → OCR result model: returns blocks
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/paddle_ocr_engine.py - Tesseract engine → OCR result model: returns blocks
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/tesseract_ocr_engine.py - Hybrid OCR → OCR result model: returns OCR result
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/ocr/hybrid_ocr_engine.py - Pipeline orchestrator → Dealer extraction: extracts dealer
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Pipeline orchestrator → Model extraction: extracts model
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Pipeline orchestrator → Horsepower extraction: extracts horsepower
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Pipeline orchestrator → Asset cost extraction: extracts asset cost
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Pipeline orchestrator → Field optimizers: optimizes fields
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Pipeline orchestrator → Stamp and signature detection: detects document marks
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Pipeline orchestrator → Confidence scoring: scores extraction
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Dealer extraction → Fuzzy matching: matches names
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/dealer_name_extractor.py - Model extraction → Fuzzy matching: matches models
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/extraction/unified_model_extractor.py - Pipeline orchestrator → Gemini fallback: uses fallback
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py - Pipeline orchestrator → Cost tracking: tracks processing cost
IIT_GUWAHATI_CONVOLVE_TRACK-OCR-main/src/main.py