How sriram-2090/ocr-features works
This repository digitizes cropped handwritten dates, postal PINs, and short codes, then routes results toward automated acceptance or operator review. Its principal workflow runs from a form image through segmentation, CNN character recognition, grammar and semantic correction, and confidence gating; the web interfaces expose predictions and review controls. The README also documents benchmark evaluation and model training. The graph reflects those documented capabilities; some server and UI internals were not sampled, so unsupported storage and dispatch details are omitted.
Main entry points: pipeline.py Field reader pipeline · dataset.py Glyph dataset generator · evaluate_field_reader.py Benchmark evaluation · app.js Web operator UI
Components 13
Operator interfaces
- Web operator UI
web/js/app.js - Gradio interface
ocr_standalone_app.py
Recognition pipeline
- Field reader pipeline
src/field_reader/pipeline.py - Glyph segmentation
src/field_reader/segmenter.py - Character CNN
src/field_reader/model.py - Grammar decoder
src/field_reader/decoder.py - Semantic verifier
src/field_reader/semantic_verifier.py
Model preparation
- Glyph dataset generator
src/field_reader/dataset.py - CNN weights
models/field_cnn.pth
Serving and evaluation
- FastAPI service
server.py - Benchmark evaluation
evaluate_field_reader.py - Benchmark field data
data/form_fields/metadata.csv
Other components
- Form operator
Connections 14
- Form operator → Web operator UI: uses
web/js/app.js - Form operator → Gradio interface: uses
ocr_standalone_app.py - Web operator UI → FastAPI service: requests predictions
web/js/app.js - FastAPI service → Field reader pipeline: processes fields
server.py - Gradio interface → Field reader pipeline: processes fields
ocr_standalone_app.py - Field reader pipeline → Glyph segmentation: segments glyphs
src/field_reader/pipeline.py - Field reader pipeline → Character CNN: classifies glyphs
src/field_reader/pipeline.py - Field reader pipeline → Grammar decoder: decodes candidates
src/field_reader/pipeline.py - Field reader pipeline → Semantic verifier: verifies semantics
README.md - Glyph dataset generator → Glyph segmentation: normalizes training glyphs
src/field_reader/dataset.py - Glyph dataset generator → Character CNN: uses vocabulary
src/field_reader/dataset.py - Benchmark evaluation → Field reader pipeline: evaluates modes
evaluate_field_reader.py - Benchmark evaluation → Benchmark field data: reads benchmark fields
evaluate_field_reader.py - Field reader pipeline → CNN weights: loads model weights
README.md