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
47.9k stars 5.67k forks source link

The new mask got in 2th iteration is not limited in the area of mask_input, why? #663

Open Yuanen-Pang opened 10 months ago

Yuanen-Pang commented 10 months ago

Wonderful jobs! I want to ask your help for a strange phenomenon. In my images, there are two kinds of things (let's call them A and B) which are hard to separate at once. Fortunately, apart from them, the remains in my image are single color(call it C). So, (1) Firstly, I set many foreground points in the center and some background in the edge and put all of them into predict function to get the masks of A and B(the edges are most C, so it's normally effective). (2) Secondly, I sent the 'logit'(returned in (1) by predict function), which contains A and B, and original image to extract the mask again. Meanwhile, I reduce the number of points promptation to 1(I set many times using same 'logit') to separate A and B.

However, I find the new mask returned by step(2) are outside the area of 'logit' which was input in step(2). Why does it happen? Isn't the new mask only in the area of logit?