Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with SAM2 producing segmentation masks as points and lines #697

Merged

Conversation

PawelPeczek-Roboflow
Copy link
Collaborator

Description

We had a problem with SAM2 model - sometimes it produces segmentation masks being points or lines. That do not come in line with sv.Detections(...) which skip the mask if it contains less than 3 points instead leaving blank. That was colliding with the code that associate detections id (more detections were visible - vs trimmed list in sv.Detections). Added filtering of malformed segmentations early-on

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

  • E2E test

Any specific deployment considerations

For example, documentation changes, usability, usage/costs, secrets, etc.

Docs

  • Docs updated? What were the changes:

@PawelPeczek-Roboflow PawelPeczek-Roboflow merged commit dc9362b into main Sep 30, 2024
57 checks passed
@PawelPeczek-Roboflow PawelPeczek-Roboflow deleted the fix/sam2_producing_lines_as_segmentation_masks branch September 30, 2024 15:17
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