GithubHelp home page GithubHelp logo

seawee1 / did-somebody-say-corgi Goto Github PK

View Code? Open in Web Editor NEW
87.0 2.0 6.0 127.83 MB

Image Synthesis + Corgis = <3

Python 0.02% Jupyter Notebook 99.98% Shell 0.01%
stylegan2 stylegan2-ada pretrained-model pretrained corgi image-synthesis image-synth stylegan animals corgis

did-somebody-say-corgi's Introduction

Did Somebody Say Corgi?

A 1024x1024 StyleGAN2-ADA model trained on corgi images found on Instagram.

Model Results Final model results

doggo_.mp4

Thread on /r/MachineLearning

This repository features:

If you use this repository in your research or a personal project I'd love to hear about it! :)

Project Outline

In the following I will give a rough overview about what I did in this project for everyone interested.

Dataset Creation

After I made the decision that it would be a great project to train a StyleGAN2 model on images of corgis (I can't exactly remember why though haha) I first searched the internet for a preexisting high-resolution corgi image dataset. Suprisingly (not really) I wasn't able to find any, so I had to create my own dataset. After some experiments I decided that I could probably get more than enough corgi images of Instagram. I started with scrapping 350000 corgi images as an initial data base.

Because StyleGAN2 usually requires uniform and clean data to achieve good results I then performed some heuristic-based preprocessing on the initial dataset. My filtering criteria were:

  • Only one corgi per image
  • Should be as centered around the corgi as possible
    • Filtered by looking at center shift between corgi detection bounding box and square crop window
  • Should fill out a minimum percentage of the image (i.e. should not be too small)
    • In order to artificially increase overlap I allowed the cropping algorithm to use a crop window as small as 800x800 and upsample the crop to 1024x1024 from there.
  • No duplicates (using imgdupes)

This reduced the dataset to 136255 high-quality 1024x1024 corgi images. For more details have a look at the dataset notebook.

Good samples

Bad samples

Model Training

The rest was easy. I first experimented with training the model on TPUs provided by the Tensorflow Research Cloud (TFRC). In my case this just didn't work (but I'm aware other StyleGAN projects which successfully did this using the same repositories as I did), because training speed was much to slow. That's when I got myself a Google Colab Pro subscription and trained the StyleGAN2 model for 18 days on a Tesla V100. This however does not include a lot of days where something went wrong and nothing progressed. Overall I was occupied with starting Colab runtimes every day for ~1 month.

Have a look at the train/test notebook for more details. You can also use this notebook to train your own model!

Future Work

The initial plan was to further explore the trained model, e.g. search for meaningful latent space directions and other StyleGAN related methods proposed in recent literature. If anybody comes about to do this I'd be happy to hear from you. I imagine the corgi latent space to have some funny characteristics.

did-somebody-say-corgi's People

Contributors

seawee1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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