This is the code base for our paper Unpaired Pose-Guided Human Image Generation.We propose a new network architecture to generate human images from body part models, with unpaired training dataset.
Here you can find the necessary training and testing code, and the datasets and pre-trained models for shirt and tshirt (upper body) and suit and dress (full body).
- Linux or macOS
- Python 2 or 3
- NVIDIA GPU + CUDA CuDNN
- Install PyTorch and dependencies from http://pytorch.org
- Install Torch vision from the source.
git clone https://github.com/pytorch/vision
cd vision
python setup.py install
pip install visdom
pip install dominate
- Clone this repo:
git clone git@github.com:cx921003/UPG-GAN.git
cd UPG-GAN
- Download a dataset from our Google Drive.
- Unzip the dataset under
./datasets/
folder.
- Download a pre-trained model from our Google Drive.
- Unzip the model under
./checkpoints/
folder.
- Configure the following arguments in
./testing.sh
:dataroot
: the path to the datasetname
: the name of the model, make sure the model exists under./checkpoint/
how_many
: number of input images to testn_samples
: number of samples per input image
- Test the model:
./testing.sh
- Configure the following arguments in
./training.sh
:dataroot
: the path to the datasetname
: the name of the model
- Train a model:
./training.sh
- To view training results and loss plots, run
python -m visdom.server
and click the URL http://localhost:8097. To see more intermediate results, check out./checkpoints/suit_and_dress/web/index.html
The test results will be saved to a html file here: ./results/suit_and_dress/latest_test/index.html
.
If you find this repository useful for your research, please cite our paper.
to be added
Code is heavily based on pytorch-CycleGAN-and-pix2pix written by Jun-Yan Zhu and Taesung Park.