facebookresearch / segment-anything

The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
Apache License 2.0
46.94k stars 5.56k forks source link

Difference between SAM's Automatic Mask Generator in demo and code #494

Open amirreza-asadzadeh opened 1 year ago

amirreza-asadzadeh commented 1 year ago

Hey, I have tested multiple images with the demo version on the official website with Automatic Mask Generator, and also have tested them with the same module in the code, and I always get different segmentation masks. Usually the segmentation masks in the demo look better.

Q1) Is there any post-processing on the masks in the demo version? Q2) What are the input parameters of the automatic mask generator used in demo?

I use the following code to initialize the automatic mask generator with custom parameters.

mask_generator = SamAutomaticMaskGenerator(model=sam, points_per_side=32, pred_iou_thresh=0.95, crop_n_layers=2)
bjhpc commented 1 year ago

hey,i meet the same problem with you, my question is#491, and i can not solve it untill now. when you have some approaches,please reply to me,thanks

qevr commented 1 year ago

@bjhpc @amirreza-asadzadeh Did you guys find any solution to this ? or do you know how SAM Automatic Mask Generator was trained ?

maliozer commented 11 months ago

I have the same question, why demo "everything" options works better than SamAutomaticMaskGenerator

DiegoMoralesBravo commented 10 months ago

Following

sqhuang0103 commented 9 months ago

Following