Official PyTorch implementation of ASC adaptation.
Note: The base model is taken from Few-shot-gan-adaptation
- Linux
- NVIDIA GPU + CUDA CuDNN 10.2
- PyTorch 1.7.0
- Python 3.6.9
- Install all the libraries through
pip install -r requirements.txt
- FFHQ Note: Please download it into your training path.
10 shot
5 shot
Note: Please download it into your training <root/raw_data> path.
python prepare_data.py --out ./processed_data/<dataset_name> --size 256 ./raw_data/<dataset_name>
CUDA_VISIBLE_DEVICES=0 python train.py --ckpt_source /path/to/source_model --data_path /path/to/target_data --exp <exp_name> \
--use_ema --use_rel_ema --k 1.0 --extra_ema \
--use_flow --winsize_inc 1.0002 --winsize 16 --cutoff 0.6 \
--use_pred --pred_noiseW 2.0 --use_flow_pred --blur 7 \
--LFC --m 2 --LFCw 0.5 --extra_step 0
- Sketches test set from Few-shot-gan-adaptation --> link
- Babies test set from Few-shot-gan-adaptation --> link
- Sunglassies test set from Few-shot-gan-adaptation --> link
- Animation Faces test set from AniGAN --> link
# if there is a large dataset of the target, use --test_imgs for FID evaluation
# if not, please remove this option.
CUDA_VISIBLE_DEVICES=0 python evals.py --ckpt_source /path/to/source_model --model_ckpt /path/to/target_model \
--out /path/to/out --train_imgs /path/to/processed_data/domain --source_key <domain_key> \
--batch 64 --n_sample <test_sample_count> --seed <number> --test_imgs /path/raw_data/domain/images/
Note: To evaluate identity, please training source to target first, then try to re-train it to FFHQ again with this following ffhq-10s images:
# if there is a large dataset of the target, use --test_imgs for FID evaluation
# if not, please remove this option.
CUDA_VISIBLE_DEVICES=0 python evals.py --ckpt_source /path/to/source_model --model_ckpt /path/to/target_model \
--out /path/to/out --train_imgs /path/to/processed_data/domain --source_key <domain_key> \
--batch 64 --n_sample <test_sample_count> --seed <number> --test_imgs /path/raw_data/domain/images/
CUDA_VISIBLE_DEVICES=0 python recon_evals.py --source_ckpt /path/to/source_model --model_ckpt /path/to/target_model \
--out /path/to/out --source_key <domain_key> \
--batch 4 --n_sample <test_sample_count> --seed <number>