[TPAMI 2024] FEditNet : Few-Shot Editing of Latent Semantics in GAN Spaces with Correlated Attribute Disentanglement
Ran Yi, Teng Hu, Mengfei Xia, Yizhe Tang, and Yong-Jin Liu,
pip install pytorch==1.13.1
pip install torchvision==0.14.1
pip install opencv-python==4.7.0.72
pip install numpy==1.23.1
pip install pillow==9.4.0
pip install tqdm==4.65.0
Checkpoints prepare: Download the StyleGAN checkpoint.
Data prepare: schedule the dataset as:
- dataset
- celeba-test
- $attr1
- 0.png
- 1.png
- ...
- $attr2
- 0.png
- 1.png
- ...
- ...
where $attri
if the name for the ith attribute, e.g., Smile, Old.
To train the model on one attributes attr
, you can run:
python3 train_editnet.py --name=$attr
To train the model on two attributes attri
and attrj
, you can run:
python3 train_editnet2.py --attr1=$attri --attr2=$attrj
After training the model, you can generate image by running:
python3 test-decoupled_generator.py --attr=$attri-$attrj
If you find this code helpful for your research, please cite:
@article{yi2024feditnet ,
title={FEditNet : Few-Shot Editing of Latent Semantics in GAN Spaces with Correlated Attribute Disentanglement},
author={Yi, Ran and Hu, Teng and Xia, Mengfei and Tang, Yizhe and Liu, Yong-Jin},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
year={2024},
publisher={IEEE}
}