JuliaWolleb / Diffusion-based-Segmentation

This is the official Pytorch implementation of the paper "Diffusion Models for Implicit Image Segmentation Ensembles".
MIT License
272 stars 35 forks source link

Question about save the generate mask #11

Closed xuecheng990531 closed 1 year ago

xuecheng990531 commented 1 year ago

th.save(s, './results/'+str(slice_ID)+'_output'+str(i))

  1. I see that in segment_sample.py, the above code can be used to generate a mask. how exactly is this done, the resulting file cannot be opened.
  2. The number of channels of S is 5, how to get the mask?
JuliaWolleb commented 1 year ago
  1. the sample is the output of your diffusion model, which is saved as a torch tensor s. you can open it with torch.load.
  2. the sample s should have a channel number of 1. This is the mask.
xuecheng990531 commented 1 year ago

Thanks a lot