GithubHelp home page GithubHelp logo

usefulai / stylegan_blobless Goto Github PK

View Code? Open in Web Editor NEW

This project forked from podgorskiy/stylegan_blobless

0.0 1.0 0.0 8.18 MB

Original stylegan without blobs (without retraining).

Python 100.00%

stylegan_blobless's Introduction

Original Style GAN without blobs and without retraining

Simple trick to remove blobs

Demo

This work is based on my unofficial Pytorch implementation (https://github.com/podgorskiy/StyleGan) of Style GAN paper "A Style-Based Generator Architecture for Generative Adversarial Networks" https://arxiv.org/pdf/1812.04948.pdf

After cloning don't forget to run

git submodule update --init

To install requirements:

pip install -r requirements.txt

First, you will need to download model (karras2019stylegan-ffhq-1024x1024.pkl), or take your pretrainied model and put it in the root of the clonned repository.

Then, you will need to convert tensorflow model to pytorch one:

python convertor.py

After that, you can run:

python Sample.py

If you want to run a custom trained model, you might want to adjust /configs/experiment_stylegan.yaml as well as convertor.py

How it works?

See https://github.com/podgorskiy/StyleGAN_Blobless/blob/master/net.py#L260 At resolution 64x64 (that is the resolution where the artifact is introduced), all entries of the tensor that are greater than 200 are pruned (assigned 0). However, if we do so, we are going to effect statistics of the tensor and therefore will break all consiquent operations. To avoid that, two branches are executed simultaniusly: pruned one and the original one. The original one is used to compute AdaIn, coefficients which are then used to scale the pruned one.

stylegan_blobless's People

Contributors

podgorskiy 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.