facebookresearch / facebookresearch/sam2

How to adjust segment parameter to segment anything?

Open
#238 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
19.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I segment a png ,i use code as follow:

mask_generator_2 = SAM2AutomaticMaskGenerator(
model=sam2,
points_per_side=64,
points_per_batch=128,
pred_iou_thresh=0.7,
stability_score_thresh=0.92,
stability_score_offset=0.7,
crop_n_layers=1,
box_nms_thresh=0.7,
crop_n_points_downscale_factor=2,
min_mask_region_area=25.0,
use_m2m=True,
)

and i get the result as follow:
![output](https://github.com/user-attachments/assets/8a424b11-fa5e-4f2f-a72d-1b89476cccb5)

i found i can not segment anything, and someone can help me ,how to adjust SAM2AutomaticMaskGenerator parameters to segement anything,thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.