Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mlpc-ucsd/Patch-DM
Browse files Browse the repository at this point in the history
  • Loading branch information
Mq-Zhang1 committed May 17, 2024
2 parents 7abc7dd + f1ae7c5 commit f4a9e0a
Show file tree
Hide file tree
Showing 36 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Patched Denoising Diffusion Models For High-Resolution Image Synthesis](https://arxiv.org/abs/2308.01316)
# [Patched Denoising Diffusion Models For High-Resolution Image Synthesis (ICLR 2024)](https://arxiv.org/abs/2308.01316)

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

![teaser](figs/teaser.png)

Expand All @@ -16,15 +16,15 @@ pip install -r requirements.txt

## Data Preprocessing

We provide the scipts converting images to lmdb for training. For generating dataset:
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 optimized it during training. The following code will generate initial semantic codes for training.
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} \
Expand All @@ -43,7 +43,7 @@ python train.py --batch_size 64 \

## 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 following command for training:
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 \
Expand All @@ -67,16 +67,16 @@ python test.py --batch_size 1 \
## Citation

```
@article{ding2023patched,
@inproceedings{ding2024patched,
title={Patched Denoising Diffusion Models For High-Resolution Image Synthesis},
author={Ding, Zheng and Zhang, Mengqi and Wu, Jiajun and Tu, Zhuowen},
journal={arXiv preprint arXiv:2308.01316},
year={2023}
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 following amazing works:
This project leverages knowledge from the following amazing works:
[DiffAE](https://github.com/phizaz/diffae),
[Guided Diffusion](https://github.com/openai/guided-diffusion).
Binary file removed __pycache__/choices.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/config.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/config_base.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/dataset.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/dataset_util.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/dist_utils.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/experiment.cpython-36.pyc
Binary file not shown.
Binary file removed __pycache__/experiment.cpython-38.pyc
Binary file not shown.
Binary file removed __pycache__/experiment.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/lmdb_writer.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/metrics.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/renderer.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/ssim.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/templates.cpython-36.pyc
Binary file not shown.
Binary file removed __pycache__/templates.cpython-38.pyc
Binary file not shown.
Binary file removed __pycache__/templates.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/templates_latent.cpython-39.pyc
Binary file not shown.
Binary file removed diffusion/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file removed diffusion/__pycache__/base.cpython-39.pyc
Binary file not shown.
Binary file removed diffusion/__pycache__/diffusion.cpython-39.pyc
Binary file not shown.
Binary file removed diffusion/__pycache__/resample.cpython-39.pyc
Binary file not shown.
Binary file removed model/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file removed model/__pycache__/blocks.cpython-39.pyc
Binary file not shown.
Binary file removed model/__pycache__/latentnet.cpython-39.pyc
Binary file not shown.
Binary file removed model/__pycache__/nn.cpython-39.pyc
Binary file not shown.
Binary file removed model/__pycache__/unet.cpython-39.pyc
Binary file not shown.
Binary file removed model/__pycache__/unet_autoenc.cpython-39.pyc
Binary file not shown.
Binary file removed utils/__pycache__/choices.cpython-39.pyc
Binary file not shown.
Binary file removed utils/__pycache__/dataset.cpython-39.pyc
Binary file not shown.
Binary file removed utils/__pycache__/dataset_util.cpython-39.pyc
Binary file not shown.
Binary file removed utils/__pycache__/dist_utils.cpython-39.pyc
Binary file not shown.
Binary file removed utils/__pycache__/lmdb_writer.cpython-39.pyc
Binary file not shown.
Binary file removed utils/__pycache__/metrics.cpython-39.pyc
Binary file not shown.
Binary file removed utils/__pycache__/renderer.cpython-39.pyc
Binary file not shown.

0 comments on commit f4a9e0a

Please sign in to comment.