Alias-Free GAN

An unofficial version of Alias-Free Generative Adversarial Networks (https://arxiv.org/abs/2106.12423). This repository was heavily based on Kim Seonghyeon's (rosinality) implementation. The goal of this version is to be maintainable, easy to use, and expand the features of existing implementations. This is built using pytorch and pytorch lightning (a framework that abstracts away much of the hardware specific code).

See open issues unsupported features, planned features, and current bugs.

Licence

MIT licence badge

This project is officially licensed as an MIT project. However, it's requested that you use this repository with the intention of actively elevating historically marginalized communities. Avoid using this project for creating anything that inflicts physical or psychological violence on individuals, groups, or animals.

Financial Support

If you have the financial means please consider contributing to this project or creators of pretrained models.

This project takes money to run because while many continuos integration (ci) tools are free to open source projects, they do not offer the necessary hardware to run tests on GPUs or TPUs. Because of this the ci testing needs to be run using Google Cloud Platform which charges for GPU and TPU instances. Any financial contributions to this project will first go to covering those costs first.

Licenses and contributions for pretrained models is designed to be flexible so please review the information for a particular model before using it.

Buy me a coffee: https://www.buymeacoffee.com/duskvirkus

Tezos Wallet Address: tz1PeE5NQyyjyJdnyqyKdtFN27TvN9j3ZcUe - Only send tezos to this wallet.

Examples

training example gif

Example of animation made from samples generated in training process.


linear interpolation example

Example of linear interpolation between two random seeds.


circular loop example

Example of circular loop interpolation.


noise loop example

Example of open simplex noise loop interpolation.


rosinality translate example

Example output from converted rosinality translate script.

Supported Model Architectures

Below is a list of supported model architecture. The hope is to support NVlabs code when it comes out.

model-architecture Base Repository Repository Version Limit [start,end) Description
alias-free-rosinality-v1 https://github.com/rosinality/alias-free-gan-pytorch [fixed model commit on July 7th 2021, _) Based on rosinality implementation after some model fixes.

Notes:

Notebooks

GPU Colab Training Notebook

devel Branch

View Notebook

Open In Colab

stable Branch

View Notebook

Open In Colab

GPU Colab Inference Notebook

devel Branch

View Notebook

Open In Colab

stable Branch

View Notebook

Open In Colab

TPU Notebooks

Coming at some point in the future.

Pre-trained Models

See pretrained_models.json.

Use model_name as --resume_from argument for trainer.py.

Pretrained models will automatically download using wget but here's link's if that isn't working for some reason. Place them under a pretrained directory in project root directory.

rosinality-ffhq-800k

Description: A 256 model trained by rosinality on ffhq dataset for 800k steps at a batch size of 16.

Contributing

Contribute Pretrained Models

Contributing your trained models for others to transfer learn off of or use in their projects. This helps reduce the training time and resources required to use.

You can do so by creating a pull request to the stable branch. Add information about your model to the to pretrained_models.json using the template below.

        {
            "model_name": "model-name-no-spaces-no-file-extension",
            "creator": "github username",
            "model_architecture": "see model architecture section",
            "description": "Describe your model. What was it trained on? How long was it trained for? Feel free to include links to make donations and suggested donation amounts. Also include licence information such as creative commons or other licencees.",
            "model_size": 512,
            "wget_url": "Please include a link to download your model in you're pull request and I will update this", 
            "sha1": "If you know how to make a sha1 hash then you can fill this out if not leave this blank."
        }

Contribute Notebooks

If you make a notebook and want to share it that is welcome. If it's just a notebook you can just make a pull request to stable. If it requires changes to the code base please open an issue to discuss which branch it should go on.

Other Contributions

Other contributions are welcome but open an issue to discuss what you want to change/add. Unless it's a small non breaking bug fix pull requests may or may not be accepted without discussion beforehand.

GitHub

https://github.com/duskvirkus/alias-free-gan