Home

Awesome

AIRR

Official code of Supervised Attribute Information Removal and Reconstruction for Image Manipulation. [pdf]

Dependencies

Our code is built on Python3, Pytorch 1.11 and CUDA 11.3.

Data

  1. Download preprocessed annotation files, including parsing maps of Deepfashion Fine-Grained Attribute and CelebA. Unzip it and put the data folder under the current directory.
  2. Download and unzip Deepfashion Synthesis. Put the unzippped FashionSynthesisBenchmark/ folder under data/synthesis/.
  3. Download and unzip the original Deepfashion Fine-Grained Attribute annotations and imgs.zip. Put these files under data/attr/. Run create_deepfashion_finegrained.py to resize all images to 224x224.
  4. Download and unzip aligned face images from CelebA. Put the unzippped img_align_celeba/ folder under data/celeba/.
  5. Download and unzip high resolution face images from CelebA-HQ. Put the unzipped CelebAMask-HQ folder under data/celebahq.

Pretrained models

Download and unzip the pretrained attribute classifier and AIRR models. Put the unzipped folders under the current directory.

Train

Run train.py.

To train on CelebA-HQ, please clone pSp repository to the current directory. You also need to download their pretrained image decoder weights for ffhq.

Test

Run test.py. This should generate all test images with the specified attribute under save_dir. Please specify save_dir, the dataset and the attribute that you would like to manipulate in test.py.

To test on CelebA-HQ, please clone pSp repository to the current directory.