Giter VIP home page Giter VIP logo

toad-gan's Introduction

TOAD-GAN

Official pytorch implementation of the paper: "TOAD-GAN: Coherent Style Level Generation from a Single Example" For more information on TOAD-GAN, please refer to the paper (arxiv).

If you're interested in a demonstration of pre-trained generators, check out TOAD-GUI. The GUI allows you to generate, edit and play Super Mario Bros. levels generated by TOAD-GANs.

This Project includes graphics from the game Super Mario Bros. It is not affiliated with or endorsed by Nintendo. The project was built for research purposes only.

Getting Started

This section includes the necessary steps to train TOAD-GAN on your system.

Python

You will need Python 3 and the packages specified in requirements.txt. We recommend setting up a virtual environment with pip and installing the packages there.

NOTE: If you have a GPU, check if it is usable with Pytorch and change the requirement in the file to use +gpu instead of +cpu. Training on a GPU is significantly faster.

Install packages with:

$ pip3 install -r requirements.txt -f "https://download.pytorch.org/whl/torch_stable.html"

Make sure you use the pip3 that belongs to your previously defined virtual environment.

TOAD-GAN

Training

Once all prerequisites are installed, TOAD-GAN can be trained by running main.py. Make sure you are using the python installation you installed the prerequisites into.

There are several command line options available for training. These are defined in config.py. An example call which will train a 3-layer TOAD-GAN on level 1-1 of Super Mario Bros. with 4000 iterations each scale would be:

$ python main.py --input-dir input --input-name lvl_1-1.txt --num_layer 3 --alpha 100 --niter 4000 --nfc 64

Generating samples

If you want to use your trained TOAD-GAN to generate more samples, use generate_samples.py. Make sure you define the path to a pretrained TOAD-GAN and the correct input parameters it was trained with.

$ python generate_samples.py  --out_ path/to/pretrained/TOAD-GAN --input-dir input --input-name lvl_1-1.txt --num_layer 3 --alpha 100 --niter 4000 --nfc 64

Experiments

We supply the code for experiments made for our paper. These files come with their own command line parameters each to control the experiment. Check the files for more info.

TPKL-Divergence

$ python main_tile_pattern.py

Level Latent Space

$ python main_level_classification.py

Level Authoring

$ python generate_samples.py --seed_mariokart_road 

Built With

  • Pillow - Python Image Library for displaying images
  • Pytorch - Deep Learning Framework

Authors

  • Maren Awiszus - Institut für Informationsverarbeitung, Leibniz University Hanover
  • Frederik Schubert - Institut für Informationsverarbeitung, Leibniz University Hanover

Copyright

This code is not endorsed by Nintendo and is only intended for research purposes. Mario is a Nintendo character which the authors don’t own any rights to. Nintendo is also the sole owner of all the graphical assets in the game.

toad-gan's People

Contributors

mawiszus avatar

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.