facebookresearch / facebookresearch/segment-anything
Add a 'max_mask_region_area' option to SamAutomaticMaskGenerator
- Dominant language
- Jupyter Notebook
- Stars
- 54.9k
- Forks
- 6.4k
- PR merge metrics
- No merged PRs in 30d
Description
Hi there!
I am currently experimenting with the SAM model in "segment anything" mode on CT-Scans to segment organs of the human anatomy. Although the model performs well in distinguishing different parts, it also segments the background and larger structures.
Unfortunately, I have been unable to find a way to limit the maximum segment size in pixels. The model currently only allows for setting a minimum segment size. I believe it would be a valuable addition if there were an option to set a maximum size as well.
Thank you for considering this suggestion!
Contributor guide
Research direction
Start by locating SamAutomaticMaskGenerator and review how its existing minimum segment-size behavior is configured and applied. Add a max_mask_region_area option that excludes regions exceeding the requested pixel area, then verify that the generator retains only regions within both size limits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook
- Domain
- computer-vision, machine-learning
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100