JuliaWolleb / Diffusion-based-Segmentation

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

Does the sampling result include the original image and mask #33

Closed guanzhenghua closed 1 year ago

guanzhenghua commented 1 year ago

Thank you very much for providing the code. Download BRAST2020 data set and preprocess it into (1,240,240) according to the method in the paper. image

The training and sampling process were successfully carried out, but the sampling result was a little strange, including the original image and mask.Because the final image generated in the paper only has a mask.So I wonder if I'm doing something wrong. And here's the sampling result. image My sincere thanks to you again. and look forward to your reply.

saisusmitha commented 1 year ago

@guanzhenghua In the below-mentioned code - the sample is the output mask - and I think it's only output segmentation - I don't know how you are getting everything included.

sample, x_noisy, org = sample_fn( model, (args.batch_size, 3, args.image_size, args.image_size), img, clip_denoised=args.clip_denoised, model_kwargs=model_kwargs, )

Can you share the pre-processing code - the original 3D to 2d slice wise folder code.

guanzhenghua commented 1 year ago

@saisusmitha of course, it is easy to slice 3D to 2D, i will show the code later. I processed the data in the author's way, From the picture, it should be fine. I'm sure the data preprocessing is fine, but the result does include a mixture of the original and the segmentation, so i wonder and need the author's answer. Have you run this program successfully. maybe we can talk more in email: guanzhenghua2022@email.szu.edu.cn I am looking forward to your email. image Copying the code directly will look strange, please forgive me for using the screenshot of the code.

saisusmitha commented 1 year ago

@guanzhenghua were you able to solve this? Are you getting the segmentation sample properly?

guanzhenghua commented 1 year ago

@saisusmitha the author answer this question in #13, it is true thar the sampling result include the original image and mask, so in order to get perfert mask which is sampled by original image, should another operate that is add the threshold to separate the profile and the mask.