hasan1292 / mDDPM

Unsupervised Anomaly Detection in Medical Images Using Masked Diffusion Model
MIT License
80 stars 7 forks source link

Question on "mask" #1

Closed fujistoo closed 1 year ago

fujistoo commented 1 year ago

Hi! Awesome work you've done here :)

What exactly does batch["mask"] refer to? I went through the create_dataset.py and noticed that you created the mask yourself if no masks are available. I'm quite new on scalar images / medical datasets, so wasn't sure what does that mean.

On the contrary, if I'd like to test this on other non-medical datasets, i.e. VisA, how should I modify these lines here? Realistically, my datamodule would contain batch["image"] as the input (healthy image) and also some ground-truth masks paired with "unhealthy" images for testing.

hasan1292 commented 1 year ago

Hi. That one is just in case the mask is not given. It will create a mask on run-time. However, if you provide the mask, that condition will not be used.

fujistoo commented 1 year ago

Gotcha, most appreciated! Is there an inference script, or did I miss it somewhere?