Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ghaiszaher/jumpynn
A trial to train a neural network to play Facebook's Jumpy Jumpy Game
https://github.com/ghaiszaher/jumpynn
jupyter-notebook machine-learning neural-network
Last synced: 27 days ago
JSON representation
A trial to train a neural network to play Facebook's Jumpy Jumpy Game
- Host: GitHub
- URL: https://github.com/ghaiszaher/jumpynn
- Owner: ghaiszaher
- License: gpl-3.0
- Created: 2019-03-22T21:56:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-05T18:45:27.000Z (over 4 years ago)
- Last Synced: 2024-08-25T13:06:46.107Z (2 months ago)
- Topics: jupyter-notebook, machine-learning, neural-network
- Language: Jupyter Notebook
- Homepage: http://ghaiszaher.me/JumpyNN/
- Size: 23.6 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JumpyNN
This project is a trial to train a neural network to play [Facebook's Jumpy Jumpy Game](https://www.facebook.com/instantgames/198982457542294)
# Code
The full source code is available under GPL-3.0 License in my Github repository [ghaiszaher/JumpyNN](https://github.com/ghaiszaher/JumpyNN)
## Dependencies
Make sure that the following are installed:
* Python3
* Keras
* Tensorflow
* Opencv2 & Numpy
* Pillow
* pynput
* mss
* Jupyter Notebook## Adjust Configuration Files
For this version, auto-calibration was not made. You need to open [Facebook's Jumpy Jumpy Game](https://www.facebook.com/instantgames/198982457542294) and go to the file "jumpy_settings" to adjust the following:
* monitor.left & monitor.top: the location of the game's div relative to the screen
* monitor.width & monitor.height: the size of the game's div## Adjust Template Files
Template files are responsible for determining wether the current screen is Main Menu, Scoreboard or Continue Playing. They are located in _templates_ folder:
You need to replace these 3 images with images taken from your screen inside the gameplay.
## Adjust Ball Color
From inside the game, make sure to adjust the ball color to the Pink one, otherwise you will need to change the colors settings.
## Capture Data
Run the file "record.py" and play the game to collect images & outputs for your gameplay.
A new folder will be created "gameplay_logs" that contains images + mouse dragging movement info during the gameplay.## Train
* Extract features from images and generate Training Data: Run the jupyter notebook 's file generate_X_y. This will generate several files called "features_X_y.npz", the final one will be in "gameplay_logs/features_X_y.npz", and will contain the training data from all the images combined.
* Run the jupyter notebook's file "train.ipynb" to create and run the neural network. Final Neural Network files (config & weights) will be stored in "gameplay_logs"## Test Trained Data
Run the file "run.py" to test## Results
Trained network's gameplay:
## Note
If you're trying to run this on Windows, you might have some issues with mouse drag using pyautogui library. I tested it on Ubuntu 18.04.2 LTS.
© Ghais Zaher 2020