Runhui Huang, Jianhua Han, Guansong Lu, Xiaodan Liang, Yihan Zeng, Wei Zhang, and Hang Xu
ICCV 2023
Sampled image using the prompt: A large bed sitting next to a small Christmas Tree surrounded by pictures
This folder provides a re-implementation of this paper in PyTorch, developed as part of the course METU CENG 796 - Deep Generative Models. The re-implementation is provided by:
- Furkan Genç, [email protected]
- Barış Sarper Tezcan, [email protected]
Please see the jupyter notebook file main.ipynb for a summary of paper, the implementation notes and our experimental results
To set up the environment for this project, please follow the steps below:
-
Create a new conda environment named
DiffDis
:conda create -n DiffDis
-
Activate the newly created environment:
conda activate DiffDis
-
Install PyTorch and related libraries with CUDA support:
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
-
Install additional required Python packages from the
requirements.txt
file:pip install -r requirements.txt
Navigate to the scripts
directory where the project scripts are located:
cd scripts
To download the necessary data for the project, execute the following script:
bash download_data.sh
To download and extract the CC3M dataset, run the following scripts in order:
-
Download the CC3M dataset:
bash download_cc3m_dataset.sh
-
Extract the downloaded CC3M dataset:
bash extract_cc3m_dataset.sh
Navigate to the code
directory where the project code is located:
cd code
-
Training: Run the following command to train the model:
python train.py
-
Testing: Run the following command to test the model:
python test.py
-
Inference: Run the following command to generate images:
python inference.py
Note: Adjust the config.py
parameters according to your needs before running the scripts.
The model trained on the CC3M dataset for two-thirds of an epoch can be found in this link.