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
Video of several example
variationKirby.mp4
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))
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.
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
each 10 ticks, the model would generate a series of fake images, seeing the development:
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!