How girijesh-s001/palm-leaf-project works
This repository implements an OCR service for historical Tamil palm-leaf images. A user submits an image through the web API; the OCR orchestrator optionally crops the manuscript, segments lines and glyphs, classifies characters, and returns Unicode text, line details, confidence/accuracy metrics, and visualizations. Separate model-training and vision-model comparison capabilities are also present. The graph follows the documented pipeline and sampled calls; some internal OCR details and comparison wiring are unsampled, so uncertain links are omitted.
Main entry points: ocr_pipeline.py OCR orchestrator · app.py Flask API · predict.py Model inference · dataset_loader.py Dataset loader
Components 17
OCR processing
- OCR orchestrator
ocr_pipeline.py - Paragraph crop
LINE_SEG/paragraph_seg.py - Line segmentation
LINE_SEG/line_seg.py - Glyph segmentation
LINE_SEG/char_seg.py - OCR response
ocr_pipeline.py
CNN recognition
- Image preprocessing
Model/preprocess.py - CNN classifier
Model/cnn_model.py - Model inference
Model/predict.py - Model training
Model/train.py - Dataset loader
Model/dataset_loader.py - Labeled glyph data
dataset
Model comparisons
- CNN evaluation plots
cnn_baseline_visualizations.py - Vision-model evaluation
hf_vlm_models.py
Other components
- Image submitter
- External vision APIs
Connections 22
- Image submitter → Web page: opens
README.md - Image submitter → Flask API: submits image
app.py - Web page → Flask API: uses
- Flask API → OCR orchestrator: calls OCR
app.py - OCR orchestrator → Paragraph crop: optionally crops
ocr_pipeline.py - OCR orchestrator → Line segmentation: segments lines
ocr_pipeline.py - Line segmentation → Glyph segmentation: uses glyph slicing
LINE_SEG/line_seg.py - OCR orchestrator → Glyph segmentation: refines glyphs
ocr_pipeline.py - OCR orchestrator → Image preprocessing: prepares crops
ocr_pipeline.py - OCR orchestrator → Model inference: classifies batch
ocr_pipeline.py - Model inference → Image preprocessing: prepares image
Model/predict.py - Model inference → CNN classifier: loads model
Model/predict.py - OCR orchestrator → OCR response: assembles text
ocr_pipeline.py - Flask API → OCR response: returns JSON
app.py - Model training → Dataset loader: loads samples
Model/train.py - Dataset loader → Labeled glyph data: reads annotations and crops
Model/dataset_loader.py - Dataset loader → Image preprocessing: normalizes crops
Model/dataset_loader.py - Model training → CNN classifier: builds model
Model/train.py - CNN evaluation plots → Dataset loader: loads evaluation data
cnn_baseline_visualizations.py - CNN evaluation plots → Model inference: loads predictions
cnn_baseline_visualizations.py - Vision-model evaluation → Image preprocessing: uses preprocessing
hf_vlm_models.py - Vision-model evaluation → External vision APIs: optionally evaluates
hf_vlm_models.py