SGAN

Easy impelementation of stylegans2. You can literally train a stylegan2 in less than 10 lines of code.

Tranining

In just a few lines you can use style tranfer or train a stylegan from scratch.


from datasets import Dataset
from sgan import SGAN

dataset = Dataset('/path/to/dataset')
dataset.prepare('path/to/records')

model = SGAN()
model.train(data_path = 'path/to/records', out_dir = 'path/to/out')

Visualization

A set of functions for vis, interpolation and animation. Mostly tested in colab notebooks.

Load Model

from sgan import SGAN
model = SGAN(pkl_path = '/path/to/pkl')

Generate random

sgan.generate_randomly()

Generate grid

model.generate_grid()

Generate animation

model.generate_animation(size = 2, steps = 20)

Sample Models

Mosaics

mosaic

Medusas

medusa

Cats

cats

Jellfish

jelly

Celebs

celebs

References

GitHub