This repository contains a PyTorch implementation of Denoising Diffusion Probabilistic Models (DDPM) for image generation.
The code is based on the paper Denoising Diffusion Probabilistic Models by Ho et al.
The Denoising Network adopts the architectural design spirit seminal UNet for meidical image segmentation but leverage preactivatioin ResBlocks and Self-Attention Layers for better performance.
The training script is located in train.py
. You can run the training script with the following command:
python train.py
The sampling script is located in sample.py
. You can run the sampling script with the following command:
python sample.py \
--checkpoint_path path_to_ckpt_pth \
--num_samples 2 \
--save_dir generated_images