How badrinath2605/multilingual-ocr-web-application works
This is a Gradio multilingual OCR application backed by EasyOCR for Urdu and IndicPhotoOCR for Hindi and Kannada. The principal flow is image input and language selection, preprocessing and language routing, OCR inference, then displaying extracted text. IndicPhotoOCR identifies script, detects text regions, and recognizes text. The README also documents sample-image support. Internal wiring beyond the sampled OCR entry point is limited to relationships shown in excerpts or explicitly documented; unsampled implementation details are not assumed.
Main entry points: ocr.py OCR orchestrator · app.py Gradio interface · textbpnpp_detector.py TextBPN detector · module.py Recognition data module
Components 18
Web application
- Gradio interface
app.py - Sample images
app.py - Extracted text
app.py
Language routing
- Language router
app.py - Urdu preprocessing
app.py - EasyOCR Urdu
app.py
IndicPhotoOCR runtime
- OCR orchestrator
IndicPhotoOCR/IndicPhotoOCR/ocr.py - Script identification
IndicPhotoOCR/IndicPhotoOCR/script_identification/vit/vit_infer.py - TextBPN detector
IndicPhotoOCR/IndicPhotoOCR/detection/textbpn/textbpnpp_detector.py - TextNet model
IndicPhotoOCR/IndicPhotoOCR/detection/textbpn/network/textnet.py - Detector configuration
IndicPhotoOCR/IndicPhotoOCR/detection/textbpn/cfglib/config.py
Recognition components
- PARSeq recogniser
IndicPhotoOCR/IndicPhotoOCR/recognition/parseq_recogniser.py - PARSeq model
IndicPhotoOCR/IndicPhotoOCR/utils/strhub/models/parseq/model.py - Recognition base
IndicPhotoOCR/IndicPhotoOCR/utils/strhub/models/base.py - Recognition datasets
IndicPhotoOCR/IndicPhotoOCR/utils/strhub/data/dataset.py - Image augmentation
IndicPhotoOCR/IndicPhotoOCR/utils/strhub/data/augment.py - Recognition data module
IndicPhotoOCR/IndicPhotoOCR/utils/strhub/data/module.py
Other components
- User
Connections 18
- User → Gradio interface: uploads image
README.md - Gradio interface → Language router: submits input
app.py - Sample images → Gradio interface: offers examples
README.md - Language router → Urdu preprocessing: routes Urdu
app.py - Urdu preprocessing → EasyOCR Urdu: preprocesses image
app.py - Language router → OCR orchestrator: routes Indic
app.py - EasyOCR Urdu → Extracted text: returns text
app.py - OCR orchestrator → TextBPN detector: initializes detector
IndicPhotoOCR/IndicPhotoOCR/ocr.py - OCR orchestrator → PARSeq recogniser: initializes recogniser
IndicPhotoOCR/IndicPhotoOCR/ocr.py - OCR orchestrator → Script identification: initializes identifier
IndicPhotoOCR/IndicPhotoOCR/ocr.py - TextBPN detector → TextNet model: constructs model
IndicPhotoOCR/IndicPhotoOCR/detection/textbpn/textbpnpp_detector.py - TextBPN detector → Detector configuration: loads configuration
IndicPhotoOCR/IndicPhotoOCR/detection/textbpn/textbpnpp_detector.py - PARSeq recogniser → PARSeq model: uses model
- PARSeq model → Recognition base: extends runtime
- Recognition data module → Recognition datasets: builds datasets
IndicPhotoOCR/IndicPhotoOCR/utils/strhub/data/module.py - Recognition data module → Image augmentation: loads augmentation
IndicPhotoOCR/IndicPhotoOCR/utils/strhub/data/module.py - OCR orchestrator → Extracted text: returns text
README.md - Gradio interface → Extracted text: displays text
README.md