Project-MONAI / GenerativeModels

MONAI Generative Models makes it easy to train, evaluate, and deploy generative models and related applications
Apache License 2.0
555 stars 78 forks source link

Added SPADE-LDM code taking into account new changes to main: #436

Closed virginiafdez closed 7 months ago

virginiafdez commented 7 months ago
Modification of diffusion_model_unet to allow for SPADE normalisation to be set up as an option
Modification of autoencoder_kl to allow for SPADE normalisation to be set up as an option
Modification of inferer and latent inferer to allow for label to be passed through forward when SPADE is active
Addition of tests to: test_spade_diffusion
Creation of tutorial for 2D using OASIS subset of images.

Even though I implemented tests, we should check very thoroughly that this works before merging, especially since the presence of SPADE norm needs for labels to be passed to the forward method, and ANY call of forward without a label if SPADE Is on will end up in error. In the same fashion, we should ensure that ANY call on forward when SPADE is not on is not disrupted (code doesn't error out because of a label missing).