| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
self-driving MarioKart with TensorFlow
Driving a new (untrained) section of the Royal Raceway:
Driving Luigi Raceway:
The model was trained with:
With even a small training set the model is sometimes able to generalize to a new track (Royal Raceway seen above).
Notes
Run python utils.py viewer samples/luigi_raceway to view the samples
Run python utils.py prepare samples/* with an array of sample directories to build an X and y matrix for training. (zsh will expand samples/* to all the directories. Passing a glob directly also works)
X is a 3-Dimensional array of images
y is the expected joystick ouput as an array:
[0] joystick x axis [1] joystick y axis [2] button a [3] button b [4] button rb
The train.py program will train a model using Google's TensorFlow framework and cuDNN for GPU acceleration. Training can take a while (~1 hour) depending on how much data you are training with. The program will save the model to disk when it is done.
The play.py program will take screenshots of your desktop expecting the emulator to be in the top left corner again. These images will be sent to the model to acquire the joystick command to send.
Note - you need to start the emulator a custom input driver in order to pass the output from the AI to the emulator:
mupen64plus --input ~/src/mupen64plus-input-bot/mupen64plus-input-bot.so MarioKart64.z64
Open a PR! I promise I am friendly :)
| Back | FazBrowse Home | New Git URL |