GitXplorerGitXplorer
t

image-generation

public
4 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
6e77fe137dab70c685a3250eac4bb771e0bff77b

Update README.md

committed 3 months ago
Unverified
a3d6915272b1d71f4fb2aa05439faacbc69375f5

fix

committed a year ago
Unverified
00a2bdae5518006e58f71705458f46ebcff8f56c

fix

committed a year ago
Unverified
eb5eaf3f86bc16f331fa3aa60b910b9f2094ff2f

fix

committed a year ago
Unverified
8d30fdd66988939e32fa9674d119a84ef633c0f5

fix

committed a year ago
Unverified
f4008c08f274c5ae8cf3cc7c9610e1000c73cdea

fix

committed a year ago

README

The README file for this repository.

Image generation with Diffusion Model

In this repository was implemented homework at the Deep Learning university course. During this homework I implemented DCGAN, CVAE and DDPM. All models are successfully trained with the except for DDPM.

The original task statement.

Code organization

├── README.md                        <- Top-level README
├── report-ru.pdf                    <- report on Russian language
├── requirements.txt                 <- project requirements
├── train.py                         <- train code
├── congigs/                         <- models configs
│   ├── cvae_mnist_train.json
│   ├── cvae32x32_train.json
│   ├── cvae64x64_train.json
│   ├── cvae256x256_train.json
│   └── dcgan_train.json
│   
├── results/...                      <- images and gifs with results
│   
├── scripts/               
│   └── create_gif.ipynb             <- download images from wandb, convert to gif
│
└── src/                             
    ├── datasets/                   
    │   ├── artbench10_32x32.py
    │   ├── artbench10_256x256.py
    │   ├── base_dataset.py
    │   ├── cats_faces.py
    │   └── mnist_wrapper.py 
    │            
    ├── models/                     
    │   ├── cvae/
    │   │   └── cvae.py
    │   │   
    │   ├── dcgan/
    │   │   └── dcgan.py
    │   │   
    │   ├── ddpm/
    │   │   ├── diffusion.py
    │   │   └── unet.py
    │   ├── __init__.py                 
    │   └── base_model.py                 
    │   
    ├── trainers/                    
    │   ├── __init__.py                 
    │   ├── trainer.py               <- cvae and ddpm trainer           
    │   └── gan_trainer.py           <- gan trainer                
    │
    ├── utils/   
    │   ├── __init__.py 
    │   └── utils.py                 <- inf_loop, WandbWriter, LocalWriter, images conversion functions
    │   
    ├── __init__.py
    └── collate.py                   <- collate_fn, collate_w_target_fn

Installation

  1. To install libraries run from the root directory
pip3 install -r requirements.txt
  1. I used 3 datasets:

Train

python3 train.py -c config_path -w True

DCGAN results

Generated samples during training Final generated samples

CVAE results

Reconstructed images during training (real in the second row) Generated samples during training Final generated samples

CVAE possesses the potential to train on ArtBench-10, but 12 hours on free Kaggle's resources are not enough for such complex dataset.

Report & Wandb

  1. report-ru.pdf (only Russian).
  2. GAN wandb project.
  3. CVAE wandb project.

Authors

  • Timofei Gritsaev

Credits

DCGAN implementation was taken from the pytorch DCGAN tutorial.

DDPM impementation was taken from the DL-2 in HSE homework, which is based on the openai/guided-diffusion. Unet implementation was taken from the Pytorch-UNet.