How tanhdz228/od-ocr-system-for-engineering-drawings works
ODOCR accepts engineering drawings through either a command-line batch runner or a Gradio demo, then detects PartDrawing, Note, and Table regions and produces crops, OCR content, JSON, and visualizations. Detection and the two OCR paths are distinct runtime stages; table extraction includes line-based structure detection and fallback methods. The README also documents a separate model-development workflow for dataset preparation, augmentation, training, cross-validation, and evaluation. Some integrations and training links are documented but their source was not sampled, so those edges cite the README.
Main entry points: pipeline.py Image pipeline · table_ocr.py Table OCR · train_cv.py Cross-validation · prepare_dataset.py Dataset conversion
Components 18
User Entry
- Web demo
app.py - CLI runner
inference.py
Inference Pipeline
- Image pipeline
src/pipeline.py - Region detector
src/detection/detector.py - JSON and visualization
src/pipeline.py
OCR Extraction
- Note OCR
src/ocr/note_ocr.py - Table OCR
src/ocr/table_ocr.py - Table structure
src/ocr/table_structure.py - OCR engines
- Table Transformer
Model Development
- COCO annotations
data/annotations/coco_all.json - CV split generation
scripts/preprocessing/create_cv_splits.py - Dataset conversion
scripts/training/prepare_dataset.py - Dataset augmentation
scripts/preprocessing/augment_dataset.py - Model training
scripts/training/train.py - Cross-validation
scripts/training/train_cv.py - Model evaluation
scripts/training/evaluate.py
Other components
- Drawing user
Connections 22
- Drawing user → Web demo: uploads drawing
README.md - Drawing user → CLI runner: provides image
README.md - Web demo → Image pipeline: runs inference
app.py - CLI runner → Image pipeline: processes images
inference.py - Image pipeline → Region detector: detects regions
src/pipeline.py - Image pipeline → Note OCR: routes Note crops
src/pipeline.py - Image pipeline → Table OCR: routes Table crops
src/pipeline.py - Image pipeline → JSON and visualization: writes results
src/pipeline.py - Image pipeline → Region detector: draws boxes
src/pipeline.py - Table OCR → Table structure: detects grid
src/ocr/table_ocr.py - Note OCR → OCR engines: recognizes text
README.md - Table OCR → OCR engines: reads cells
README.md - Table OCR → Table Transformer: fallback recognition
README.md - COCO annotations → CV split generation: creates folds
README.md - COCO annotations → Dataset conversion: converts labels
README.md - CV split generation → Cross-validation: supplies fold splits
README.md - Dataset conversion → Dataset augmentation: feeds training images
README.md - Dataset augmentation → Model training: provides augmented data
README.md - Model training → Model evaluation: evaluates weights
README.md - Cross-validation → Dataset conversion: prepares fold data
README.md - Cross-validation → Dataset augmentation: optionally augments
README.md - Cross-validation → Model training: runs fold training
README.md