Code Monkey home page Code Monkey logo

style-based-gan-pytorch's Introduction

Style-Based GAN in PyTorch

Update (2019/09/01)

I found bugs in the implementation thanks to @adambielski and @TropComplique! (rosinality#33, rosinality#34) I have fixed this and updated checkpoints

Update (2019/07/04)
  • Now trainer uses pre-resized lmdb dataset for more stable data loading and training.
  • Model architecture is now more closely matches with official implementation.

Implementation of A Style-Based Generator Architecture for Generative Adversarial Networks (https://arxiv.org/abs/1812.04948) in PyTorch

Usage:

You should prepare lmdb dataset

python prepare_data.py --out LMDB_PATH --n_worker N_WORKER DATASET_PATH

This will convert images to jpeg and pre-resizes it. (For example, 8/16/32/64/128/256/512/1024) Then you can train StyleGAN.

for celebA

python train.py --mixing LMDB_PATH

for FFHQ

python train.py --mixing --loss r1 --sched LMDB_PATH

Resolution Model & Optimizer
256px Link
512px Link
1024px Link

Model & Optimizer checkpoints saved at the end of phases of each resolution. (that is, 512px checkpoint saved at the end of 512px training.)

Sample

Sample of the model trained on FFHQ Style mixing sample of the model trained on FFHQ

512px sample from the generator trained on FFHQ.

Old Checkpoints

Resolution Model & Optimizer Running average of generator
128px Link 100k iter Link
256px Link 140k iter Link
512px Link 180k iter Link

Old version of checkpoints. As gradient penalty and discriminator activations are different, it is better to use new checkpoints to do some training. But you can use these checkpoints to make samples as generator architecture is not changed.

Running average of generator is saved at the specified iterations. So these two are saved at different iterations. (Yes, this is my mistake.)

style-based-gan-pytorch's People

Contributors

rosinality avatar michaelmonashev avatar penguinbing avatar andreasjansson avatar vinayakarannil avatar

Stargazers

J avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.