Teach T-Rex to dodge obstacles in 3 stages.
1- Collect dataset when playing. 🎮
2- Train dataset while drinking your coffee. ☕
3- Start and watch it.
requirements.txt consists required dependencies.
Easy way: You can install the requirements with the following commands:
cd myproject/
virtualenv venv
./venv/bin/activate
pip install -r requirements.txt
-
Firstly, you must specify ROI(Region Of Interest) according to screen resolution.
-
Change limits your specified ROI.
limits = {"top":375, "left": 740, "width":250, "height": 100 }
- Run & Play
python trex_getdata.py
When each press direction buttons, it save ROI pixels. Such like:
Just run following command:
python trex_train.py
Run and start the game.
python trex_play.py
- The playing pixels and the dataset collection pixels must be the same. Because program watches and grabs your ROI pixels.
- Your score affects train and test accuracy in dataset collection stage. Also best record of T-Rex too.
- Linux users must switch to super user mode with
sudo su
command for keyboard library.
For playing T-Rex Runner: http://www.trex-game.skipser.com/