Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 1.85 KB

README.md

File metadata and controls

71 lines (50 loc) · 1.85 KB

T-Rex-Runner-CNN

Teach T-Rex to dodge obstacles in 3 stages.

Stages

1- Collect dataset when playing. 🎮
2- Train dataset while drinking your coffee. ☕
3- Start and watch it.

Requirements

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

1- Collect dataset when playing. 🎮

  1. Firstly, you must specify ROI(Region Of Interest) according to screen resolution.
    trex_map_roi

  2. Change limits your specified ROI.

limits = {"top":375, "left": 740, "width":250, "height": 100 }
  1. Run & Play
python trex_getdata.py

When each press direction buttons, it save ROI pixels. Such like:
roi

2- Train dataset while drinking your coffee ☕

Just run following command:

python trex_train.py

3- Start and watch it

Run and start the game.

python trex_play.py

⚠️ IMPORTANT NOTES ⚠️

  • 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/