How harshlunia7/indicstr12_icdar works
Project Type and Purpose
• This is an open-source research codebase for Indic scene text recognition (“IndicSTR12_ICDAR”), implementing three different model pipelines (CRNN, STAR-Net, and Parseq) on the same dataset, with end-to-end scripts for data preparation, training, evaluation, and demos.
High-Level File Structure Analysis
• Top-Level Directories:
• crnn/ – Implementation of the CRNN model pipeline
• starnet/ – Implementation of the STAR-Net model pipeline
• parseq/ – Implementation of the Parseq model pipeline (with Hydra‐style config management)
• Shared Concerns:
• dataset.py, utils.py in each pipeline for data loading, preprocessing, lexicon handling
• demo*.py and script.sh for inference demos
• train.py, finetune.py, mytrain.py for training loops
• tool/ subfolder for data-conversion utilities (LMDB creation, format converters)
• parseq/ additionally contains:
• config/ and configs/ for dataset, model, experiment definitions via YAML
• strhub/ subpackage exposing models as a PyTorch Hub entry point
Key Components
A. Data Layer
– Raw Scene Text Images (IndicSTR12 dataset)
– Data Conversion Tools (tool/ scripts → LMDB, Coco, etc.)
– Preprocessing Modules (dataset.py → resize, normalize, augment)
B. Core Model Pipelines (three parallel blocks)
1. CRNN Pipeline (crnn/models/... )
• Transformation → Feature Extraction → Sequence Modeling → CTC Decoder
2. STAR-Net Pipeline (starnet/models/modules/…)
• Spatial Transformer → CNN Backbone → RNN or Attention → Decoder
3. Parseq Pipeline (parseq/strhub/models/parseq)
• Patch Embedding → Transformer Encoder → Positional Encoding → Sequence Head
– Each pipeline has: training script, finetune script, demo script
C. Configuration & Orchestration
– parseq’s Hydra configs (config/*.yaml)
– params.py or params dictionaries in CRNN/STAR-Net
– Script wrappers (script.sh) to launch jobs (single-GPU or distributed)
D. External Frameworks & Libraries
– PyTorch (core DL)
– Hydra (configuration)
– LMDB, OpenCV or PIL (I/O)
– Lua Torch conversion (convert_t7.lua)
E. Outputs & Evaluation
– Trained model artifacts (.pt, .t7)
– Logs, metrics (accuracy, CER/WER)
– Demo visualizations (overlayed text)
Relationships and Data Flows
• From Preprocessed Data → each Pipeline’s Data Loader
• Within each Pipeline block: Data Loader → Preprocessing → Model → Loss Computation → Checkpoint Writer
• From Checkpoint → Inference Demo → Output Images/Reports
• Configuration inputs (YAML/params.py) feed into both Training and Demo scripts
Architectural Patterns & Design Principles
• Modular pipeline design: clearly separated data, model, and training modules
• Single responsibility: each script or module does one job (convert, load, train, demo)
• Extensibility points: add new model under strhub/models or new config in parseq/configs
• Reusable utilities in utils.py and common tool scripts