Dressing in Order (DiOr)



[Running this code]

The official implementation of “Dressing in Order: Recurrent Person Image Generation for Pose Transfer, Virtual Try-on and Outfit Editing”. by Aiyu Cui, Daniel McKee and Svetlana Lazebnik. (ICCV 2021)


Supported Try-on Applications

Supported Editing Applications

More results

Play with demo.ipynb!

Get Started

Please follow the installation instruction in GFLA to install the environment.

Then run

pip install -r requirements.txt

If one wants to run inference only: You can use later version of PyTorch and you don’t need to worry about how to install GFLA’s cuda functions. Please specify --frozen_flownet.


We run experiments on Deepfashion Dataset. To set up the dataset:

  1. Download and unzip img_highres.zip from the deepfashion inshop dataset at $DATA_ROOT
  2. Download the train/val split and pre-processed keypoints annotations from GFLA source or PATN source, and put the .csv and .lst files at $DATA_ROOT.
    • If one wants to extract the keypoints from scratch, please run OpenPose as the pose estimator. Please follow the instruction from PATN for how to generate the keypoints in desired format.
  3. Run python tools/generate_fashion_dataset.py to split the data. (Please specify the $DATA_ROOT accordingly.)
  4. Get human parsing. You can obtain the parsing by either:
    • Run off-the-shelf human parser SCHP (with LIP labels) on $DATA_ROOT/train and $DATA_ROOT/test. Name the output parses folder as $DATA_ROOT/trainM_lip and $DATA_ROOT/testM_lip respectively.
    • Download the preprocessed parsing from here and put it under $DATA_ROOT.
  5. Download standard_test_anns.txt for fast visualization.

After the processing, you should have the dataset folder formatted like:

|   + train (all training images)
|   |   - xxx.jpg
|   |     ...
|   + trainM_lip (human parse of all training images)
|   |   - xxx.png
|   |     ...
|   + test (all test images)
|   |   - xxx.jpg
|   |     ...
|   + testM_lip (human parse of all test images)
|   |   - xxx.png
|   |     ...
|   - fashion-pairs-train.csv (paired poses for training)
|   - fashion-pairs-test.csv (paired poses for test)
|   - fashion-annotation-train.csv (keypoints for training images)
|   - fashion-annotation-test.csv  (keypoints for test images)
|   - train.lst
|   - test.lst
|   - standard_test_anns.txt

Run Demo

Please download the pretrained weights from here and unzip at checkpoints/.

After downloading the pretrained model and setting the data, you can try out our applications in notebook demo.ipynb.

(The checkpoints above are reproduced, so there could be slightly difference in quantitative evaluation from the reported results. To get the original results, please check our released generated images here.)

(DIORv1_64 was trained with a minor difference in code, but it may give better visual results in some applications. If one wants to try it, specify --netG diorv1.)


Warmup the Global Flow Field Estimator

Note, if you don’t want to warmup the Global Flow Field Estimator, you can extract its weights from GFLA by downloading the pretrained weights GFLA from here.

Otherwise, run

sh scripts/run_pose.sh


After warming up the flownet, train the pipeline by

sh scripts/run_train.sh

Run tensorboard --logdir checkpoints/$EXP_NAME/train to check tensorboard. Resetting discriminators may help training when it stucks at local minimals.


To download our generated images (256×176 reported in paper): here.


To run evaluation (SSIM, FID and LPIPS) on pose transfer task:

sh scripts/run_eval.sh

Cite us!

If you find this work is helpful, please consider to star
this repo and cite us as

  title={Dressing in Order: Recurrent Person Image Generation for Pose Transfer, Virtual Try-on and Outfit Editing},
  author={Cui, Aiyu and McKee, Daniel and Lazebnik, Svetlana},
  journal={arXiv preprint arXiv:2104.07021},


This repository is built up on GFLA, pytorch-CycleGAN-and-pix2pix, and MUNIT. Please be aware of their licenses when using the code.

Thanks a lot for the great work to the pioneer researchers!