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

gaohuazuo/stylegan2-pytorch

 
 

StyleGAN 2 in PyTorch

Implementation of Analyzing and Improving the Image Quality of StyleGAN (https://arxiv.org/abs/1912.04958) in PyTorch

Notice

I have tried to match official implementation as close as possible, but maybe there are some details I missed. So please use this implementation with care.

Usage

First create lmdb datasets:

python prepare_data.py --out LMDB_PATH --n_worker N_WORKER --size SIZE1,SIZE2,SIZE3,... DATASET_PATH

This will convert images to jpeg and pre-resizes it. This implementation does not use progressive growing, but you can create multiple resolution datasets using size arguments with comma separated lists, for the cases that you want to try another resolutions later.

Then you can train model in distributed settings

python -m torch.distributed.launch --nproc_per_node=N_GPU --master_port=PORT train.py --batch BATCH_SIZE --g_reg_every 8 LMDB_PATH

train.py supports Weights & Biases logging. If you want to use it, add --wandb arguments to the script.

Samples

Sample with truncation

At 110,000 iterations. (trained on 3.52M images)

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 87.6%
  • Cuda 10.8%
  • C++ 1.6%