Official code of Supervised Attribute Information Removal and Reconstruction for Image Manipulation. [pdf]
Our code is built on Python3, Pytorch 1.11 and CUDA 11.3.
- 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. - Download and unzip Deepfashion Synthesis. Put the unzippped
FashionSynthesisBenchmark/
folder underdata/synthesis/
. - Download and unzip the original Deepfashion Fine-Grained Attribute annotations and imgs.zip. Put these files under
data/attr/
. Runcreate_deepfashion_finegrained.py
to resize all images to 224x224. - Download and unzip aligned face images from CelebA. Put the unzippped
img_align_celeba/
folder underdata/celeba/
. - Download and unzip high resolution face images from CelebA-HQ. Put the unzipped
CelebAMask-HQ
folder underdata/celebahq
.
Download and unzip the pretrained attribute classifier and AIRR models. Put the unzipped folders under the current directory.
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.
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.