Giter Site home page Giter Site logo

airgesture's Introduction

[PYTHON] AirGesture - Play games without touching keyboard

Introduction

Here is my python source code for AirGesture - Play games without touching keyboard. This project is an application of hand detection model in Tensorflow. With my code, you could play many games on PC without using any keyboard. At the moment you could play the following games

  • Super Mario Bros by running the script mario.py
  • Battle City by running the script battle_city.py
  • Dinosaur Game by running the script dinosaur.py

Please make sure that only one hand shown in front of camera. Otherwise scripts may not work as well as you expect

Super Mario Bros

The screen is splitted into 3 equal parts horizontally. Here is the mapping between your gesture and Mario's movement:

  • Open hand within the left part -> Left jump
  • Closed hand within the left part -> Left run
  • Open hand within the middle part -> Jump
  • Closed hand within the middle part -> Do nothing
  • Open hand within the right part -> Right jump
  • Closed hand within the right part -> Right run


Super Mario Bros

Battle City

The screen is splitted into 5 parts, including 4 triangles and a circle. Here is the mapping between your gesture and tank's movement:

  • Open hand -> Fire
  • Closed hand within the circle -> Do nothing
  • Closed hand within the left triangle -> Go left
  • Closed hand within the right triangle -> Go right
  • Closed hand within the up triangle -> Go up
  • Closed hand within the left triangle -> Go down


Battle City

Dinosaur Game

The screen is splitted into 2 equal parts vertically. Here is the mapping between your gesture and dinosaur's action:

  • Closed hand -> Run
  • Open hand within the upper part -> Jump
  • Open hand within the lower part -> Duck


Dinosaur

Requirements

  • python 3.x
  • cv2
  • tensorflow
  • numpy
  • gym
  • gym_super_mario_bros
  • gym_chrome_dino
  • pygame
  • opencv

airgesture's People

Contributors

uvipen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airgesture's Issues

Unable to run mario.py

Hello,
I just cloned your repo and try to run your project but it was not running. It's giving this error. Please guide me through this need some guidelines:
Screenshot (24)

game

Why can't I open the game interface? I can only turn on the camera.Hope to answer

Error in battle_city.py

Traceback (most recent call last):
File "C:/Users/User/Downloads/Compressed/AirGesture-master/battle_city.py", line 12, in
tf.flags.DEFINE_integer("width", 640, "Screen width")
AttributeError: module 'tensorflow' has no attribute 'flags'

Need helps....asap !

help me solve this error!!!

DuplicateFlagError: The flag 'width' is defined twice. First from C:/Users/Rajdeep/Desktop/mario/AirGesture-master/mario.py, Second from C:/Users/Rajdeep/Desktop/mario/AirGesture-master/mario.py. Description from first occurrence: Screen [width](url)

image

Version

Could you state all the version of all the libraries you used as it would resolve few of my errors.

Tensorflow Pretrained Model

Can you tell me exactly which pretrained model did you use for the project?

Also, how many different gestures can it recognize other than closed and open?

Thanks!

config

Could you share the config file of the tf model?or the checkpoint?

Tensorflow

Hi,

Thansk for great project.
Do you use tensorflow-cpu or tensorflow-GPU?

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.