Zhifeng Xie · Hao Li · Huiming Ding · Mengtian Li · Xinhan Di · Ying Cao*
AAAI 2025
* Corresponding author
This setup was tested with Ubuntu 22.04.4 LTS
, CUDA Version: 11.3
, and Python 3.8.5
.
First, clone the github repo...
git clone [email protected]:haoli-zbdbc/hierafashdiff.git
cd hierafashdiff
Then download the weights via
wget https://huggingface.co/vmip-shu/HieraFashDiff/resolve/main/hfd_100epochs.ckpt?download=true -P checkpoints/
Now you have either the option to setup a virtual environment and install all required packages with pip
pip install -r requirements.txt
or if you prefer to use conda
create the conda environment via
conda env create -f environment.yml
or docker
deploy
docker build -t hfddm .
docker run -it -d --restart always --shm-size 128g --gpus device=0 --name hfddm -v /path/to/HieraFashDiff:/app -p 0.0.0.0:8000:8000 hfddm
Now you should be able to design! 👗
You can just run the python script gradio_hfd.py
as follows
python gradio_hfd.py
You need to download HieraFashion dataset from Google Drive and unzip to your own path /path/to/HieraFashion
. The dataset folder structure should be as follows:
HieraFashion
├── train_images
│ ├── 000000_0.jpg
│ ├── .......
│ └── WOMEN-Sweatshirts_Hoodies-id_00006976-01_4_full.jpg
├── test_images
│ ├── 78_0.jpg
│ ├── .......
│ └── WOMEN-Sweatshirts_Hoodies-id_00007240-01_4_full.jpg
├── train_pose
│ ├── json
│ └── pose_images
├── test.json
├── train.json
└── train_pose.json
Important
Replace all the /path/to
paths in the code and configuration files with real paths.
/path/to
paths exist in all the configuration files under the folder utils/config.py
and run huggingface-cli download --resume-download laion/CLIP-ViT-H-14-laion2B-s32B-b79K --local-dir checkpoints/CLIP-ViT-H-14-laion2B-s32B-b79K
.
You need to write a simple script to read this dataset for pytorch. (In fact we have written it for you in scripts/train/my_dataset.py
.)
python scripts/train/my_dataset.py
Train the code with the following command:
python scripts/train/train_cldm.py
Note that we first fine-tune the stable diffusion model on the Dress Code Multimodal.You can download the pre-trained model(control_dresscode_ini.ckpt) from Huggingface.
Please cite our paper:
@article{xie2024hierarchical,
title={HieraFashDiff: Hierarchical Fashion Design with Multi-stage Diffusion Models},
author={Xie, Zhifeng and Li, Hao and Ding, Huiming and Li, Mengtian and Di, Xinhan and Cao, Ying},
journal={arXiv preprint arXiv:2401.07450},
year={2024}
}