Table of Contents
Python module containing custom classes of neutral network architectures for generating artificial pokemon sprites.
The module was constructed using the following libraries,
and the following data resources,
To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
-
Clone the repo,
git clone https://github.com/sephwalker321/PokeGAN
-
Install the requiremnts
pip install -m requirements.txt
- Install the module
pip install -e .
Jupyter Notebooks are provided for the demonstration of the training proceedure.
- Notebooks/train.ipynb load in data and train the GAN
User can add their own training images in data/sprites. Many default parameters of the module can be altered in pokegan/config.yaml
In the notebook example we introduce a set of simple on-the-fly image augmentations to effectively increase the dataset size or reduce its complexity.
-
Alpha mask filter (4xHxW -> 3xHxW)
-
Random rotations
-
Random horizontal flipping
-
Resize to 3x32x32 Images
-
Image normalisation
This yeilds an example batch,
Now we create the GAN. We create the generator and discrimator and wrap them into a custom GAN class and begin the training. We feed the generator with a noisy vector input which we can represent graphically,
The generator transforms this random noise into a new pokemon sprite which attempts to deceive the discriminator. Over time the generator compares the training images and the artifical images to trys to classify them. Over time they both improve. Here are some example generated images over time for 10, 50, 100 and 500 epochs.
Over the training time we can plot the losses of the two networks,
Lastly, lets see how the discriminator performs by comparing a heatmap of the discriminator scores against some example fake and real images,
- Take the epoch plots to create a video of the training proceedure
- Study the latent space representation of the noise
- Can we add a further input for the pokemon types to enhance the GAN?
Distributed under the MIT License. See LICENSE
for more information.
For any issues or questions contact Joseph Walker
Project Link: https://github.com/sephwalker321/PokeGAN](https://github.com/sephwalker321/PokeGAN)