Giter Club home page Giter Club logo

kirbygan's Introduction

Project Link

Seeing the famous PokemonGan, as a Kirby favor, I intent to create a Gan special for kirby(a nintendo character):

Link to github KirbyGan Github

Link to Colab Open in Colab

Video of several example

variationKirby.mp4

Process

Image Process

First of all, I find that there is no existing dataset for kirby only on kaggle or Huggingface, so I decided to create one by myself. I decided to use web crawler to scrape images from Google, and I've found this: AutoCrawler, works soundly, then I got 703 images of Kirby.

After processd by hands😭, also I used python to clip them into size of 256x256, I uploaded this dataset to kaggle: KirbyDataset

or download with kaggle API:

kaggle datasets download -d turbihao/nintendo-kirby-dataset

Clip the images to 256*256

imgs = []
path = "/Users/turqoise/Downloads/AutoCrawler-master/download/kirby"
new_path = "/Users/turqoise/Downloads/kirby"
valid_images = [".jpg",".gif",".png",".tga",".jpeg"]
size = 256

for i,f in enumerate(os.listdir(path)):
    ext = os.path.splitext(f)[1]
    if ext.lower() not in valid_images:
        continue
    
    img = Image.open(os.path.join(path,f))
    w,h = img.size
    filename = str(i) + ".jpg"
    print(filename)
    if w==h:
        img.resize((size,size)).convert('RGB').save(os.path.join(new_path,filename))
    
    elif w>h:
        img.crop(((w-h)/2,0,(w-h)/2+h,h)).resize((size,size)).convert('RGB').save(os.path.join(new_path,filename))
    
    elif h>w:
        img.crop((0,(h-w)/2,w,(h-w)/2+w)).resize((size,size)).convert('RGB').save(os.path.join(new_path,filename))
        


Choose StyleGan3

the PokemonGan is based on DCGAN, while I find that the stylegan3 is up to date and may have better performance. So I choose the styleGan3 as my main method.

Here's the official link to it: nvlabs styleGan3

and also someone has established API on Colab with some pre-trained model as .pkl file to play with.

github link

Open in Colab

Pre-trian my own *.pkl model

the model has many specific version requirement in terms of downloading the packages, I finnaly find this tutorials by Jeff Heaton suits what I want: video tutorial on youtube


github Link of the process


each 10 ticks, the model would generate a series of fake images, seeing the development:


Reflection

As the feature of kirby is becoming various shapes and stuffs, so I am quite comfortable about the final results that the images seem to be like fluid, hahahah.. But my kirby do not have feet...I guess this is due to my dataset is not so clearly as my processing of the images is not enough with various backgrounds in each images. Also I might test more epoches in the future. Thanks!

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.