How samar7q/handwritten_images_to_word_docx works
This product turns uploaded or command-line handwritten notes into downloadable, editable Word documents. The main workflow preprocesses an image, optionally detects and masks diagrams, runs OCR with selectable or fallback engines, corrects and structures the extracted text, then generates a Word file with diagrams embedded. The web UI also exposes model selection, progress, previews, and OCR metrics. The graph reflects the documented workflow and sampled call sites; unsampled implementation details and uncertain internal wiring are omitted.
Main entry points: app.py Streamlit UI · hybrid_ocr.py Hybrid OCR · main_pipeline.py Pipeline Orchestrator · diagram_detector.py Diagram Detector
Components 17
User Interfaces
- Streamlit UI
app.py - CLI Entry
src/main_pipeline.py - Download Result
app.py
Conversion Workflow
- Pipeline Orchestrator
src/main_pipeline.py - Image Preprocessor
src/preprocessing/image_processor.py - Diagram Detector
src/preprocessing/diagram_detector.py
OCR Engines
- Hybrid OCR
src/ocr/hybrid_ocr.py - Vision OCR
src/ocr/vision_ocr.py - Florence OCR
src/ocr/florence_local_ocr.py - GOT-OCR
src/ocr/got_ocr_local.py - EasyOCR Fallback
src/ocr/hybrid_ocr.py
Correction and Output
- LLM Corrector
src/postprocessing/llm_corrector.py - Word Generator
src/document_generation/word_generator.py
Other components
- Notes User
- Input Image
- Groq API
- Word Document
Connections 25
- Notes User → Streamlit UI: uploads image
- Notes User → CLI Entry: provides image
- CLI Entry → Pipeline Orchestrator: starts conversion
- Streamlit UI → Image Preprocessor: preprocesses image
- Streamlit UI → Diagram Detector: detects diagrams
- Streamlit UI → Hybrid OCR: selects OCR
- Streamlit UI → LLM Corrector: requests correction
- Streamlit UI → Word Generator: creates document
- Pipeline Orchestrator → Image Preprocessor: preprocesses image
- Pipeline Orchestrator → Diagram Detector: detects diagrams
- Pipeline Orchestrator → Hybrid OCR: extracts text
- Pipeline Orchestrator → LLM Corrector: corrects text
- Pipeline Orchestrator → Word Generator: generates document
- Input Image → Image Preprocessor: image data
- Diagram Detector → Hybrid OCR: text-only image
- Diagram Detector → Word Generator: diagram images
- Hybrid OCR → Vision OCR: tries API OCR
- Hybrid OCR → Florence OCR: falls back
- Hybrid OCR → GOT-OCR: falls back
- Hybrid OCR → EasyOCR Fallback: final fallback
- Vision OCR → Groq API: sends image
- LLM Corrector → Groq API: requests correction
- Word Generator → Word Document: saves document
- Streamlit UI → Download Result: offers download
- Download Result → Word Document: reads file