Skip to content

Limit web segmentation polygons to the desktop vertex maximum - #2003

Merged
BryonLewis merged 2 commits into
mainfrom
dev/web-seg-max-polygon-points
Sep 29, 2026
Merged

BryonLewis merged 2 commits into
mainfrom
dev/web-seg-max-polygon-points

Conversation

@mattdawkins

Copy link
Copy Markdown
Member
  • Browser SAM masks only dropped sub-pixel vertices, so outlines came back with hundreds of points
  • Each ring (exterior and holes) is now cut to 25 points, as desktop's max_polygon_points
  • Point-click masks double that budget, up to 100, while the area error exceeds 5%, as desktop's max_polygon_points_limit; box and line prompts stay at 25
  • Area error is the sum of the areas between each kept edge and the contour it replaces

🤖 Generated with Claude Code

mattdawkins and others added 2 commits September 29, 2026 00:27
Rings are cut to 25 points; point-click masks grow to 100 past a 5% area error.
@BryonLewis
BryonLewis self-requested a review September 29, 2026 13:58

@BryonLewis BryonLewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Made a commit to align the constants for limits for the mask for both desktop and web so the settings don't drift from each other.

@BryonLewis
BryonLewis merged commit 7cc4b49 into main Sep 29, 2026
3 checks passed
@BryonLewis
BryonLewis deleted the dev/web-seg-max-polygon-points branch September 29, 2026 14:02
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