Unofficial implementation of StyleGAN2 config-f using TensorFlow 2.x.
- Support for TensorFlow custom operations
- Support for CPU usage
Download network parameters to weights folder manually https://drive.google.com/drive/folders/1rhuvN90EGsRhvjQq5gio8VYw7f0LojaK?usp=sharing, or simpy run download.py script located in weights folder.
# Create stylegan2 architecture (generator and discriminator) using cuda operations. model = StyleGan2(resolution, impl='cuda', gpu=True) # Load stylegan2 'ffhq' (generator and discriminator) using tensorflow operations. model = StyleGan2(weights='ffhq', impl='ref', gpu=True) # Load stylegan2 'horse' (generator and discriminator) using tensorflow operations in cpu. model = StyleGan2(weights='horse', impl='ref', gpu=False) # Load only generator network with 'car' weights generator = StyleGan2Generator(weights='car', impl, gpu)
Examples on how to create, load and run the networks can be found in example_how_to_use notebook.
Examples on how to make a random walk in the latent vector and generate a gif, can be found in example_latent_changes notebook.
Training loop and metrics has not been implemented yet. Stay tuned.