python_for_microscopists icon indicating copy to clipboard operation
python_for_microscopists copied to clipboard

Overlapping instances in fine-tuning SAM

Open Ashutosh1995 opened this issue 11 months ago • 2 comments

Hello @bnsreenu

Thanks for providing the repo for fine-tuning the SAM model on the custom dataset. My question is that in case where the instances of the object are overlapping then in that case, how can I change the code to include different boxes for different objects?

Kindly provide your suggestion? temp_binary

Ashutosh1995 avatar Mar 14 '24 09:03 Ashutosh1995

Hi man,

I think you should prepare your label as instance mask (random color for each object), then use finding contour to get different boxes. T.T

RoyAn2386 avatar Mar 17 '24 02:03 RoyAn2386

Thanks for your reply! You mean to say in this mask, assign each object with different color as in different ID, apply patchify. In that 256x256 instance, see for which instance is coming and get boxes using contours?

Also I saw in the notebook that you were using ViT-B, doesn't that internally resizes the image to be 1024x1024? If that's the case, what GPU are you using to finetune this model?

Ashutosh1995 avatar Mar 17 '24 02:03 Ashutosh1995