Add model-in-the-loop workflow: vp eval, autolabel, queue, YOLO-seg, semantic masks - #9
Merged
Merged
Conversation
…semantic masks - predictions.py: shared loader for model predictions (vp JSON, COCO results/instances JSON, YOLO txt dirs incl. Ultralytics save_txt/save_conf), resolving images to assets by asset id or original filename; unmatched references and unknown classes are reported, never dropped. - vp eval: score predictions against a split set (test by default) — per-class AP@50, mAP@50, mAP@50-95, precision/recall for box tasks; accuracy, per-class P/R/F1 and a confusion matrix for classification. --json output. - vp autolabel: persist confident predictions as annotations with source.type="model"; only unlabeled assets unless --replace; --min-confidence. - vp queue: active-learning ranking — unlabeled first (by model uncertainty when predictions are given); --include-labeled audits GT/prediction disagreement. - YOLO-seg: import polygon label lines; export polygon labels for segmentation projects (or --seg / --no-seg). - vp export --format masks: semantic-segmentation export as 8-bit class-index PNGs (0 = background), split-aware, with a classes.txt mapping. - Fixes: vp --version now reads package metadata (was hardcoded and out of sync with pyproject), deduplicated README "Release process" section, refreshed ARCHITECTURE/README/docs and CHANGELOG. 18 new tests (118 total). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the model-in-the-loop slice of the roadmap (Phase B + Benchmarking + parts of "Later"), plus a few consistency fixes.
New commands
vp eval— score model predictions against a split set (test by default), turning a locked split + snapshot into a reproducible benchmark. Box tasks get per-class AP@50, mAP@50, mAP@50-95 (COCO-style 101-point interpolation) and precision/recall at a confidence threshold; classification gets accuracy, per-class P/R/F1 and a confusion matrix.--jsonfor machine-readable output; warns when the split is unlocked.vp autolabel— persist confident predictions as annotations, recorded withsource.type = "model"so model labels stay distinguishable and auditable. Only unlabeled assets are touched unless--replace;--min-confidencefilters objects.vp queue— active-learning queue: unlabeled images first (ranked by model uncertainty when predictions are given);--include-labeledaudits existing labels for ground-truth/prediction disagreement (possible missing or stale labels).Shared infrastructure
visionpack/predictions.py— one loader for all three commands. Accepts vp-native JSON, COCO results/instances JSON, and YOLO txt directories (exactly what Ultralyticspredictwrites withsave_txt/save_confover avp exportlayout). Images resolve by asset id or original filename; unmatched references and unknown classes are surfaced, never silently dropped.Format coverage
class x1 y1 x2 y2 ...) as instance-segmentation geometry;vp export --format yolowrites YOLO-seg labels for segmentation projects (or with--seg); plain boxes degrade to four-corner polygons so mixed datasets stay trainable.vp export --format masks— semantic-segmentation export: 8-bit class-index PNG per image (0 = background), split-aware, with aclasses.txtdocumenting the pixel-value mapping.Fixes
vp --versionnow reads the installed package metadata (was hardcoded0.1.0while pyproject says0.0.1).Known limitations (documented in docs/usage.md)
Testing
test_eval.py,test_model_loop.py,test_segmentation_formats.py); full suite: 118 passing, ruff clean.vp eval(mAP 1.0 on echoed GT; precision drops correctly with an injected false positive) →vp queue→vp autolabel→ YOLO-seg and masks exports.🤖 Generated with Claude Code