Skip to content

iTs-rd/hand-gesture

Repository files navigation

Hand-Gesture

Introduction

In this project user can input pin code of any district by showing his hand
For input we use webcam to take live video input of user. User can input number by showing his/her fingers for all 6 digits one by one (one digit at a time) with the help of machine learning program will automatically count how many finger user is showing. After 6-digit number is generated it will show the result.
NOTE:-there are two boxes if you need to enter number >5 than use both boxes one hand in each else if you need to enter number <5 you can use any of the boxes


Youtube video of results

Description of all files

index.py

It is the central file that takes input and shows the output. By this code, input from the webcam is taken and extracts the region of hand and prepares image suitable for prediction and then calls a suitable function to make a prediction and show the result.

addon_function.py

It will contain all function which is used by index.py, use to organize the code

Set_HSV_values.py

When this code will runs, 3 windows are open, One will show normal video of input, 2nd window will show B&W video, and 3rd window will show 7 trackbars, you can play with the first 6 trackbars to get a good B&W video of yours in which your hand is properly distinctable. When it has done then close it.
NOTE:- If you want to reset all values then click on the reset trackbar.

model.py

This part of the code will contain everything which needs to train our model.

gen_image.py

It is used to take images of the respective class and save it to the proper place. when you press any key between 0 to 6 it will take an image of the region of interest and save it to the corresponding folder. let us assume key 3 is press then it will take the image and save it to a folder whose image corresponds to number 3. keypress:- 0 - for zero 1 - for one 2 - for two 3 - for three 4 - for four 5 - for five 6 - for random images

data

this folder contain pin code data sheet, hsv values text file and exit message.

model

this folder contain architecture of current model and weight of parameters

images

this folder will contain all images use to train model.


Required Packages

- OpenCV-python
- Numpy
- Pandas
- Tensorflow 

1 Getting Started

1.1 Installation

   

  1. Clone this repository    
git clone https://github.com/iTs-rd/hand-gesture.git

    2. Install the required packages

cd hand-gesture
pip install -r requirements.txt

If above code do not work replace pip by pip3.
It will install everything you need. If you have already installed some of the required packages it will skip that.

1.2 Check your present condition

First of all, You have to check your hand is properly detected or not.

python Set_HSV_values.py

It will open 3 windows, One will show normal video of input, 2nd window will show B&W video, and 3rd window will show 7 trackbars, you can play with the first 6 trackbars to get a good B&W video of yours in which your hand is properly distinctable. When it has done then close it. Note:- If you want to reset all values then click on reset trackbar.

If all done the program is ready to run

1.3 Run program

To run the program simply enter this line

python index.py

summary

Run these code line by line

git clone https://github.com/iTs-rd/hand-gesture.git
cd hand-gesture
pip install -r requirements.txt
python Set_HSV_values.py
python index.py


Special Thanks to Rohit Jain

Contacts

Email- Rudresh.gupta.che19@iitbhu.ac.in
Linkedin- https://www.linkedin.com/in/rudresh-gupta-b87a84190

Releases

No releases published

Packages

 
 
 

Contributors

Languages