Skip to content

feat: add metric evaluation and refinement for image2drawio pipeline #153

Open
ling0gyh wants to merge 5 commits intolz/devfrom
gyh/dev
Open

feat: add metric evaluation and refinement for image2drawio pipeline #153
ling0gyh wants to merge 5 commits intolz/devfrom
gyh/dev

Conversation

@ling0gyh
Copy link
Copy Markdown
Collaborator

Description:
Add post-processing evaluation and refinement stages to the image2drawio pipeline that detect
uncovered regions and rescue them as fallback image crops.

Changes:

  • metric_evaluator.py: Content-coverage scoring with three-channel bad-region detection (fine,
    coarse, complex) plus banner channel for wide uncovered headers. Includes text-protection
    filtering, NMS deduplication, union-coverage check against existing elements, and debug
    visualization output.
  • refinement_processor.py: Fallback rescue for uncovered regions — crops bad regions from the
    original image, filters out mostly-white regions, text-stroke regions, and regions already
    covered by existing elements, then returns them as image elements for the final XML.
  • utils.py (sample_fill_stroke): Improved stroke color extraction — detects whether shapes have a
    genuine dark border vs anti-aliased edges, avoiding false black stroke colors on colored shapes
    (pink, teal, purple, etc.).
  • utils.py (extract_text_color): Fixed inconsistent bbox clipping bounds.
  • wf_paper2drawio_sam3.py: Integrated evaluate and refine nodes into the pipeline between
    build_elements and render_xml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant