Skip to content
Generating Pokemon cards using a mixture of StyleGAN and RNN to create beautiful & vibrant cards ready for battle!
Branch: master
Clone or download
Latest commit ceee7df May 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img/templates Added RNN for moves and description and cropper May 13, 2019
rnn Updated RNN code to make it easier to generate all three types May 21, 2019
samples added sample website May 21, 2019
stylegan Added Michael Friese's pixel art model May 21, 2019
.gitignore added sample website May 21, 2019
README.md added sample website May 21, 2019
cropper-shuffle.sh added sample website May 21, 2019
cropper.sh
environment.yml init May 11, 2019
index.html added sample website May 21, 2019

README.md

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

You can’t perform that action at this time.