Home

Awesome

PoseStylizer

PyTorch implementation of "Generating Person Images with Appearance-aware Pose Stylizer" [IJCAI 2020].

@inproceedings{huang2020generating,
  title={Generating Person Images with Appearance-aware Pose Stylizer},
  author={Huang, Siyu and Xiong, Haoyi and Cheng, Zhi-Qi and Wang, Qingzhong 
          and Zhou, Xingran and Wen, Bihan and Huan, Jun and Dou, Dejing},
  booktitle={IJCAI},
  year={2020}
}
<p align="center"><img src='figs/framework.jpg' width="500"/></p> <p align="center"><img src='figs/fig1.jpg' width="800"/></p>

Getting Started

Requirement

Installation

git clone https://github.com/siyuhuang/PoseStylizer.git
cd PoseStylizer

Data Preperation

  1. Download the Market-1501 dataset dataset/market_data.zip and the DeepFashion dataset dataset/fashion_data.zip from Google Drive / Baidu Disk (Password: jl0s). The zip files include images /train /test, keypoint annotations annotation.csv, and pose transfer pairs pairs.csv.
cd dataset
unzip market_data.zip
unzip fashion_data.zip
cd ..
  1. Generate the pose heatmaps. Note, the disk space of generated heatmaps are extremely large (~18GB for Market-1501 and ~160GB for DeepFashion).
python tool/generate_pose_map_market.py
python tool/generate_pose_map_fashion.py

Test with Pretrained Models

Download our pretrained checkpoints from Google Drive / Baidu Disk (Password: jl0s).

bash test_market.sh
bash test_fashion.sh

Training

bash train_market.sh
bash train_fashion.sh

Note: We use 8 GPUs for training by default. If you have less GPUs, change --gpu_ids and --batchSize accordingly. The results are competitive to the results in our paper.

Evaluation

SSIM, IS, L1, mask-SSIM, mask-IS, mask-L1

python tool/getMetrics_market.py
python tool/getMetrics_fashion.py

PCKh

  1. Crop generated images from /results folder.
python tool/crop_market.py

    or

python tool/crop_fashion.py
  1. Compute keypoints coordinates. Change the paths input_folder and output_path in tool/compute_coordinates.py.
python2 tool/compute_coordinates.py
  1. Compute PCKh score.
python tool/calPCKH_market.py

    or

python tool/calPCKH_fashion.py

Acknowledgments

The code is written based on nice frameworks pytorch-CycleGAN-and-pix2pix and Pose-Transfer. The code is written by Dr. Siyu Huang.