Skip to content

fix(automation): round AI mask bounding boxes - #2464

Merged
wkentaro merged 1 commit into
mainfrom
fix/2336-mask-bbox-rounding
Aug 7, 2026
Merged

wkentaro merged 1 commit into
mainfrom
fix/2336-mask-bbox-rounding

Conversation

@wkentaro

@wkentaro wkentaro commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Closes #2336.

_shape_from_detection truncated the mask bbox with int() while Existing Shape Suppression rounds the same bbox, so AI mask shapes drifted up to 1px and a fractional-bbox mask fed back as an existing shape raised ValueError. The bbox now uses int(round(...)), matching the suppression contract.

Test plan

  • Updated the bbox corner regression test to the rounded contract
  • New round-trip test: a fractional-bbox AI mask re-fed as an existing shape suppresses its own detection instead of raising
  • make lint and make test (1165 passed)

@wkentaro wkentaro self-assigned this Aug 7, 2026
@wkentaro wkentaro added this to the v7.1.0 milestone Aug 7, 2026
@wkentaro
wkentaro force-pushed the fix/2336-mask-bbox-rounding branch from 9ce4d79 to d9bc061 Compare August 7, 2026 09:49
The Mask Shape builder truncated fractional bbox coordinates while suppression derived Mask extents by rounding. Round the stored points to keep placement and Existing Shape Suppression consistent.
@wkentaro
wkentaro force-pushed the fix/2336-mask-bbox-rounding branch from d9bc061 to 226176f Compare August 7, 2026 09:51
@wkentaro
wkentaro merged commit 4a0ae2d into main Aug 7, 2026
12 checks passed
@wkentaro
wkentaro deleted the fix/2336-mask-bbox-rounding branch August 7, 2026 09:53
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.

fix(_automation): mask detection bbox truncated with int() disagrees with round()-based extent contract

1 participant