Skip to content

Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch

License

MIT and 3 other licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-FID
BSD-2-Clause
LICENSE-LPIPS
Unknown
LICENSE-NVIDIA
Notifications You must be signed in to change notification settings

phymhan/stylegan2-pytorch

This branch is 161 commits ahead of, 15 commits behind rosinality/stylegan2-pytorch:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

41c4b23 · Mar 31, 2022
Dec 14, 2019
Jun 10, 2021
Jul 7, 2020
Jan 12, 2021
Jun 16, 2020
Jan 29, 2021
Jul 11, 2021
Jan 19, 2021
Dec 14, 2019
Mar 25, 2021
Apr 14, 2021
Jan 19, 2021
Dec 13, 2019
Dec 21, 2019
Dec 21, 2019
Dec 16, 2019
Oct 24, 2021
Oct 24, 2021
Oct 24, 2021
Jun 10, 2021
Jun 10, 2021
Mar 25, 2021
Jan 23, 2021
Jun 10, 2021
Apr 25, 2021
Apr 14, 2021
Jun 10, 2021
Dec 27, 2019
Apr 16, 2021
Jul 15, 2020
Mar 31, 2022
Jun 10, 2021
Apr 24, 2021
Mar 9, 2021
Apr 19, 2021
Feb 19, 2021
Mar 9, 2021
Jan 29, 2021
Mar 31, 2022
Mar 29, 2021
Sep 18, 2020
Sep 18, 2020
Sep 18, 2020
Jun 10, 2021
Mar 29, 2021
Jun 10, 2021
Jul 11, 2021
Jul 11, 2021
Jun 10, 2021
Jun 10, 2021
Jun 10, 2021
Mar 31, 2022
Mar 31, 2022

AE-StyleGAN: Improved Training of Style-Based Auto-Encoders

[arXiv] [pdf] [supp]

Model Architecture. Reconstruction.

The code is heavily based on Rosinality's PyTorch implementation of StyleGAN2.

Training

All experiments are conducted at 128x128 resolution.

Decoupled AE-StyleGAN

To train the Decoupled AE-StyleGAN, we use the following training procedure:

python train_aegan.py \
--path data/ffhq \
--sample_cache data/sample_ffhq128_64.npy \
--which_latent w_plus \
--lambda_rec_w 0 \
--iter 200000 \
--size 128 \
--name ffhq_aegan_wplus_decoupled \
--log_every 500 \
--save_every 2000 \
--eval_every 2000 \
--dataset imagefolder \
--inception inception_ffhq128.pkl \
--n_sample_fid 10000 \
--decouple_d \
--lambda_rec_d 0 \
--g_reg_every 0 \
--batch 16 \
--lr 0.0025 \
--r1 0.2048 \
--ema_kimg 5 \
--which_metric fid_sample fid_recon --use_adaptive_weight --disc_iter_start 30000

Joint AE-StyleGAN

To train the Joint AE-StyleGAN, we use the following training procedure:

python train_aegan.py \
--path data/ffhq \
--sample_cache data/sample_ffhq128_64.npy \
--iter 200000 \
--size 128 \
--name ffhq_aegan_wplus_joint \
--which_latent w_plus \
--lambda_rec_w 0 \
--log_every 500 \
--save_every 2000 \
--eval_every 2000 \
--dataset imagefolder \
--inception inception_ffhq128.pkl \
--n_sample_fid 10000 \
--lambda_rec_d 0.1 \
--lambda_fake_d 0.9 \
--lambda_fake_g 0.9 \
--joint \  # joint train G with D
--g_reg_every 0 \
--batch 16 \
--lr 0.0025 \
--r1 0.2048 \
--ema_kimg 5 \
--which_metric fid_sample fid_recon --use_adaptive_weight --disc_iter_start 30000

Baselines

To train a StyleGAN2 (without R1 regularization), we use the following training procedure:

python train.py \
--path data/ffhq \
--iter 200000 \
--size 128 \
--name ffhq_gan \
--log_every 500 \
--save_every 2000 \
--eval_every 2000 \
--dataset imagefolder \
--inception inception_ffhq128.pkl \
--n_sample_fid 10000 \
--g_reg_every 0 \
--batch 16 \
--lr 0.0025 \
--r1 0.2048 \
--ema_kimg 5 

To train a (reimplemented) Style-ALAE model, use the following command:

python train_alae.py \
--path data/ffhq \
--sample_cache data/sample_ffhq128_64.npy \
--iter 200000 \
--size 128 \
--name ffhq_alae_wtied_recw=1_mlpd=4 \
--which_latent w_tied \
--which_phi_e lin1 \
--n_mlp_d 4 \
--log_every 500 \
--save_every 2000 \
--eval_every 2000 \
--dataset imagefolder \
--inception inception_ffhq128.pkl \
--n_sample_fid 10000 \
--lambda_rec_w 1 \
--lambda_fake_d 1 \
--lambda_fake_g 1 \
--lambda_rec_d 0 \
--lambda_pix 0 \
--lambda_vgg 0 \
--lambda_adv 0 \
--g_reg_every 0 \
--batch 16 \
--lr 0.0025 \
--r1 0.2048 \
--ema_kimg 5 \
--which_metric fid_sample fid_recon

Pretrained Models

Coming soon.

Citation

If you use this code, please cite

@article{han2021ae,
  title={AE-StyleGAN: Improved Training of Style-Based Auto-Encoders},
  author={Han, Ligong and Musunuri, Sri Harsha and Min, Martin Renqiang and Gao, Ruijiang and Tian, Yu and Metaxas, Dimitris},
  journal={arXiv preprint arXiv:2110.08718},
  year={2021}
}

About

Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch

Resources

License

MIT and 3 other licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-FID
BSD-2-Clause
LICENSE-LPIPS
Unknown
LICENSE-NVIDIA

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.6%
  • Cuda 1.2%
  • C++ 0.2%