GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mlpc-ucsd/Patch-DM: (ICLR 2024) Code Release for Patch-DM

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
diffusion
diffusion
 
 
figs
figs
 
 
model
model
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
config.py
config.py
 
 
config_base.py
config_base.py
 
 
experiment.py
experiment.py
 
 
img2lmdb.py
img2lmdb.py
 
 
initialize.py
initialize.py
 
 
requirements.txt
requirements.txt
 
 
templates.py
templates.py
 
 
templates_latent.py
templates_latent.py
 
 
test.py
test.py
 
 
train.py
train.py
 
 
train_latent.py
train_latent.py
 
 

Repository files navigation

Patched Denoising Diffusion Models For High-Resolution Image Synthesis (ICLR 2024)

Zheng Ding*, Mengqi Zhang*, Jiajun Wu, Zhuowen Tu

teaser

This code is for the 1k-resolution image generation using Patch-DM.

Environment Setup

Please run the following command to install the environment.

pip install -r requirements.txt

Data Preprocessing

We provide the scripts converting images to lmdb for training.

python img2lmdb.py --input ${input_img_path} \
  --output ${lmdb_path}

Train Patch-DM

To initialize semantic code for global style consistency, we need to extract image embedding from CLIP pretrained model first and optimize it during training. The following code will generate initial semantic codes for training.

python initialize.py --data_path ${data_path} \
  --out_path ${semantic_pt_file_path}

Code for training is provided in train.py, image size should be divisible by patch size. In our experiments, we adopt 64 for patch size. Example:

python train.py --batch_size 64 \
  --patch_size 64 \
  --data_path ${lmdb_path} \
  --name exp \
  --semantic_path ${semantic_pt_file_path}

Train Latent Model

In our unconditional image generation, a latent diffusion model is trained on optimized semantic code embedding space for providing infinite new global semantic conditions. To train latent model, we directly derive semantic embedding layers from model without additional inference. Code is provided in train_latent.py, run the following command for training:

python train_latent.py --name exp_latent \
  --model_path ${Patch-DM_model_path} 

Inference

We provide the script below for inference.

python test.py --batch_size 1 \
  --patch_size 64 \
  --output_dir ${img_save_path} \
  --image_size ${height}x${width} \
  --full_path ${Patch-DM_full_model_path} \

Citation

@inproceedings{ding2024patched,
  title={Patched Denoising Diffusion Models For High-Resolution Image Synthesis},
  author={Zheng Ding and Mengqi Zhang and Jiajun Wu and Zhuowen Tu},
  booktitle={The Twelfth International Conference on Learning Representations},
  year={2024}
}

Acknowledgement

This project leverages knowledge from the following amazing works: DiffAE, Guided Diffusion.

About

(ICLR 2024) Code Release for Patch-DM

Resources

Readme
Activity
Custom properties

Stars

46 stars

Watchers

3 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.