OpenGVLab / SAM-Med2D

Official implementation of SAM-Med2D
Apache License 2.0
829 stars 80 forks source link

Training without prompting #28

Open ariharasudhanm opened 10 months ago

ariharasudhanm commented 10 months ago

I have dataset where one image have three masks which corresponds to three different classes but there are several masks without any class(masks with completely zero) and during the prompts generation process I am getting errors related to "ZeroDivisionError: integer division or modulo by zero" since there masks are completely zero , so is it possible to train without any prompts in these situation?

Cjl-MedSeg commented 8 months ago

During training, at least one mask corresponds to each image, and there is no problem with training in this scenario. It is recommended that you remove masks that only contain background and process the dataset in the format of data_demo.

ariharasudhanm commented 8 months ago

During training, at least one mask corresponds to each image, and there is no problem with training in this scenario. It is recommended that you remove masks that only contain background and process the dataset in the format of data_demo.

I am able to train now after removing the masks with only background. Additionally I have questions related to multiple masks, during training I set number of masks to 3 and during testing I get only one mask. Is it possible to get three masks for each image during testing?

lsq117 commented 4 months ago

@ariharasudhanm Hi,brother,have you solved the problem that segment more than two classes in one image?recently i meet the same problem and i dont konw how to fix it...could you tell me how you fix it later?

ariharasudhanm commented 4 months ago

Here in the testing phase, you get one mask per prompt. So basically if you want to segment 2 classes in the same image then you need at least 2 prompts. For more than one mask per one image during the testing phase, I would recommend another paper called SAM-Med where you get more than one mask per image during the testing phase.

lsq117 commented 4 months ago

@ariharasudhanm thanks very much, let me see see