Skip to content

Filter non-curve AI detections from digitization and broaden synthetic plot typography#34

Merged
14NGiestas merged 16 commits into
mainfrom
copilot/add-weights-and-check-overlays
May 16, 2026
Merged

Filter non-curve AI detections from digitization and broaden synthetic plot typography#34
14NGiestas merged 16 commits into
mainfrom
copilot/add-weights-and-check-overlays

Conversation

Copilot AI commented May 15, 2026

Copy link
Copy Markdown
Contributor
  • Inspect current synthetic curve mask generation and baseline tests
  • Add a small configurable expansion around synthetic curve masks used for training labels
  • Add/update targeted tests validating expanded curve mask behavior
  • Run targeted unit tests for render/mask logic
  • Run final validation checks

Copilot AI and others added 2 commits May 15, 2026 11:39
Copilot AI and others added 2 commits May 15, 2026 15:31

@14NGiestas 14NGiestas left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When overlaying the segmentation results back to the original image, the scale. The point extraction after the curriculumn training run. Also it's not parallel and not interpreting the segments correctly: it probably found segments like axis and axis anchors, but not using them to extract the values correctly.

- Increased CURVE_MASK_PADDING_PIXELS to 8 to create a larger area around curves for improved segmentation training
- Added interactive paint_mask mode ('m') to annotate by painting over areas and automatically extracting points
- Updated test_digitizer.py to mock run_ai_segmentation to use cv_segmentation directly for test_generate_digitize_and_validate after strict AI flow enforcement
…zation

- Switched default weights and curriculum models to yolo11n-seg.pt and yolo11s-seg.pt
- Added a validation step in start.sh after each training phase that digitizes 5 images with --overlay
- Used ThreadPoolExecutor in __init__.py to process multiple images in parallel during digitization
- Switched all curriculum stages and defaults from yolov8 to yolo11s-seg.pt
- Using the Small (s) model variant consistently across all stages ensures we can safely transfer weights between curriculum stages without shape mismatches
- Upgrading to Small instead of Nano improves segmentation recall on dense curves
- Fixed the 'mask shift' bug where ground-truth segmentation masks were slightly misaligned due to matplotlib's tight_layout() shifting axes after mask generation. The renderer now mathematically extracts the exact axes position after tight_layout() and renders the masks matching it perfectly.
- Set rect: true in the curriculum runs to prevent the YOLO dataloader from scaling the rectangular synthetic plots into 640x640 squares. This preserves aspect ratio and prevents text stretching.
- The tests import the package naturally, so forcing PYTHONPATH=src breaks imports if the package is installed/exposed by Nix rather than strictly living uninstalled under src/
- Updated the smoke test script to look for '.csv' in 'digitized/csv/' and 'synthetic/csv/' instead of the old legacy locations ('digitized/' and 'synthetic/ground_truth/') which I removed in previous refactors
- Added a PLOT_DIGITIZER_SMOKE_TEST=1 env var override in digitize_workflow.py to cleanly fallback to OpenCV contours specifically during the CI smoke test since an untrained YOLOv11s model will intentionally fail the strict curve isolation check
- The mock in 'test_generate_digitize_and_validate' was failing because 'digitize_image' signature changed to include 'imgsz'. Updated the lambda to accept this argument.
@14NGiestas 14NGiestas merged commit 575a4ca into main May 16, 2026
1 of 2 checks passed
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.

2 participants