Auto-populate a new box or line with a segmentation polygon, head/tail points or a tighter box - #1941
Open
mattdawkins wants to merge 12 commits into
Open
mattdawkins wants to merge 12 commits into
mattdawkins wants to merge 12 commits into
Conversation
…l points or a tighter box
With auto compute on the other camera, the mapped shape gets the same mask and/or points pass once the transfer succeeds; a derived head/tail follows the source camera's direction.
Lets the VIAME service keep a line-prompted mask in scale with the line.
mattdawkins
added a commit
that referenced
this pull request
Sep 20, 2026
mattdawkins
added a commit
that referenced
this pull request
Sep 20, 2026
# Conflicts: # client/dive-common/use/useModeManager.spec.ts
mattdawkins
added a commit
that referenced
this pull request
Sep 21, 2026
A box warped to the other camera whose mask overlaps it by less than half its union takes the mask's bounds instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
mattdawkins
added a commit
that referenced
this pull request
Sep 21, 2026
… is on A confirmed mask on a brand-new detection now takes the same keypoint pass as a drawn box, on the source camera and on the stereo copy. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
mattdawkins
added a commit
that referenced
this pull request
Sep 21, 2026
With auto-segmentation on, points inside the source mask are warped instead of the box corners, the other camera is segmented from them, and its box is that mask's bounds. Corner warping remains the fallback. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
mattdawkins
added a commit
that referenced
this pull request
Sep 21, 2026
…moves it The pass runs after each click's prediction on both cameras, replacing only a line it derived itself. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
mattdawkins
added a commit
that referenced
this pull request
Sep 21, 2026
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.
Two new switches under New Annotation Settings (desktop only — they use the VIAME interactive segmentation service):
polygon_keypoints(the sameadd_keypoints_from_maskhull-extremes code as the SAM2 head/tail utility pipeline). For a line, the box is tightened to the segmentation's bounds.Either switch triggers the segmentation; only what is still missing on the detection is filled in (an existing polygon or line is left alone), so a user who keeps annotating is not overwritten. Hooked through a new
onNewAnnotationGeometrycallback inuseModeManagerthat fires only for the first shape of a track being created.Progress is shown while annotations are being populated. Empty-mask responses, service errors, and results skipped because the annotation changed are reported in the viewer. A successful mask is saved before head/tail extraction, so a point-extraction failure does not discard it. Media paths and video timestamps are resolved for the annotation’s camera independently of the currently selected camera. Regression tests cover successive annotations, empty responses, partial success, and edits during pending requests.
Needs VIAME/VIAME#299 for the
polygon_keypointscommand. Helper functions (prompt construction, ring closing, bounds) are unit tested; the end-to-end flow was verified against the running service but not yet clicked through in the app.🤖 Generated with Claude Code
Multiple polygons per fish
Preserve every returned mask component and hole under one annotation, and derive head/tail from the complete mask. Line-derived bounds cover all components. Simple single-polygon responses remain supported.
Full-mask head/tail extraction requires the companion service update in VIAME/VIAME#300. Older services report extraction failure for multi-component/hole requests while retaining the saved mask, rather than silently extracting from only one component.
Validation: 18 focused DIVE tests and nine companion Python tests pass; DIVE lint and type checking pass. Model inference was not run.