Closed Salihslh closed 1 year ago
Hi
There is no line to push the generated segmentation mask to be binary. To get a binary mask to compute the dice score, we chose a thresholding on the generated segmentation mask.
During training, the ground truth segmentation mask is forced to be binary in the line 62 of the file _guideddiffusion/bratsloader.py:
label=torch.where(label > 0, 1, 0).float() #merge all tumor classes into one
Hi!
I have been looking for days for how the model generates binary masks and can't find it, could you please help?
It does not seem like the last layer is what is pushing the values to be either 0 or 1 in the generated mask, nor does it hard coded somewhere. I have changed the dataloader so that it loads images where the last channel in those images is a non-binary segmentation mask, so it does not happen here either. Could you please point out function/line that forces the generation of masks to be binary?
Kind regards, Salih