Transformers-Tutorials icon indicating copy to clipboard operation
Transformers-Tutorials copied to clipboard

problem fine tuning segment anything model

Open sushmanthreddy opened this issue 2 years ago • 3 comments

hi, @NielsRogge I have been trying to use fine-tuning segment anything model for the segmentation of cells , have gone through your following tutorial,it is great and have little confusion with bounding box extraction. if the image has multiple cells and we need to segment it , it is kind of big problem to extract multiple cells bounding box for each cell?does that code mentioned in tutorial can be used?? can we use a prompt or dot representing the cell in an image for training

for example : orginal image image Ground truth image position of prompt for samA image

can we use this other than the bounding box?? the position of the prompt can be extracted from pixel values as microscopy images are greyscale the pixel value greater than zero position can be extracted

as mentioned in paper architecture

image

can we use this method for fine tuning the model?

sushmanthreddy avatar May 18 '23 11:05 sushmanthreddy

@NielsRogge pls feel free to comment..

sushmanthreddy avatar May 18 '23 11:05 sushmanthreddy

Hi,

Yes my notebook was just one example of how you could fine-tune SAM, using a bounding box as prompt. You could indeed also fine-tune the model using other types of prompts, like points or rudimentary masks. Technically you could also use text as prompt but the SAM authors didn't release that.

NielsRogge avatar May 19 '23 10:05 NielsRogge

@NielsRogge @sushmanthreddy Can I know how big should the data set be? would 100 examples be enough? also as the pre-trained model was trained on 1024x1024, do I need to stick to that resolution? Looking forward to your reply. Thanks.

karthikdatta98 avatar Jul 12 '23 15:07 karthikdatta98