/stylegan-pokemon

Generating Pokemon cards using a mixture of StyleGAN and RNN to create beautiful & vibrant cards ready for battle!

Primary LanguagePython

Pokemon Card Generator

Generating Pokemon cards using a mixture of StyleGAN and RNN to create beautiful & vibrant cards ready for battle!

Example

Demo: https://thesepokemondonotexist.com

Run StyleGAN

StyleGAN Environment

conda env create -f environment.yml
conda activate stylegan-pokemon
cd stylegan

StyleGAN Dataset

aws s3 cp s3://devopstar/resources/stylegan-pokemon/network-snapshot-007961.pkl network-snapshot-007961.pkl
aws s3 sync s3://devopstar/resources/stylegan-pokemon/kaggle-one-shot-pokemon kaggle-one-shot-pokemon
mkdir pokemon

Prepare Images

python prepare.py
python dataset_tool.py create_from_images datasets/smalls/ ./pokemon/

StyleGAN Training

python train.py

StyleGAN Invoke [Self-trained]

Using the network-final.pkl under the most recent entry in the stylegan/results path

python invoke.py \
    --model_file './results/00000-sgan-custom-1gpu/network-final.pkl' \
    --output_file '../img/pokemon1.png'

StyleGAN Invoke [Pre-trained]

python invoke.py \
    --model_file './network-snapshot-007961.pkl' \
    --output_file '../img/pokemon2.png'

StyleGAN Invoke MichaelFriese10

aws s3 cp s3://devopstar/resources/stylegan-pokemon/MichaelFriese10_pokemon.pkl MichaelFriese10_pokemon.pkl
python invoke.py \
    --model_file './MichaelFriese10_pokemon.pkl' \
    --output_file '../img/pokemon3.png'

Run RNN

RNN Environment

conda activate stylegan-pokemon
cd rnn

RNN Dataset

Dataset is from armgilles/pokemon.csv

ls -al data/pokemon/input.txt

Moves and Descriptions come from https://pokemondb.net/move/all

ls -al data/moves/input.txt
ls -al data/desc/input.txt

RNN Training

# Pokemon
python train.py \
    --data_dir=./data/pokemon \
    --save_dir=./save/pokemon \
    --seq_length=12

# Moves
python train.py \
    --data_dir=./data/moves \
    --save_dir=./save/moves \
    --rnn_size=300 \
    --seq_length=12

# Description
python train.py \
    --data_dir=./data/desc \
    --save_dir=./save/desc \
    --seq_length=25

RNN Invoke

# Pokemon
python sample.py \
    --save_dir=./save/pokemon \
    --output_dir=../samples/pokemon.txt

# Moves
python sample.py \
    --save_dir=./save/moves \
    --output_dir=../samples/moves.txt

# Description
python sample.py \
    --save_dir=./save/desc \
    --output_dir=../samples/desc.txt \
    -n=1500

Cropping

# Define all fields adhoc
./cropper.sh \
    "Pokemon Name" \
    "Pokemon Attack 1" \
    "Pokemon Attack Description 1" \
    "Pokemon Attack 2" \
    "Pokemon Attack Description 2" \
    "img/pokemon1.png"

# Random
./cropper-shuffle.sh \
    "samples/pokemon.txt" \
    "samples/moves.txt" \
    "samples/desc.txt" \
    "img/pokemon3.png"

Web Hosting

aws s3 mb s3://thesepokemondonotexist.com
aws s3 cp index.html s3://thesepokemondonotexist.com/index.html

Attribution