IamBatman07/Diagram-Structure-Extractor
0
Diagram Structure Extractor
Upload an architecture diagram and get its structure back as schema-valid JSON: every text label, box, arrow, icon, and the relationships between components. Output is a typed Pydantic model, so the JSON parses on every call.
Endpoints
POST /extract— multipart image upload; returns the typed structure, an annotated PNG, and a flat edge CSVGET /health— liveness
Measured results (15 public diagrams with hand-written ground truth)
- Schema-valid JSON on 15 of 15 inputs, at every ablation stage
- Text detection F1 0.949 (EasyOCR), boxes 0.808 (Canny + contours), icons 1.000 (template matching)
- Arrow detection is the weak stage — F1 0.434, recall 0.346 — and relationship quality is capped by it
Source: https://github.com/Mark007-R/Diagram-Structure-Extractor
