Skip to content

Jai-Ds/Hand-Cricket-Game-using-Computer-Vision

Repository files navigation

Hand-Cricket-Game-using-Computer-Vision

Created an interactive Hand-Cricket game using OpenCV python. Hand cricket is played through gestures (called 'throws') similar to rock paper scissors. The total number of fingers extended equates to the equivalent number, with a thumb counting as 6. Throws are made simultaneously by both players, one designated as the batter and the other as the bowler. Runs scored according to the batter's throws until the bowler throws the same, in which case the batter is "out".\

Files details:-

Hand_cricket_compressed.mp4 -- Sample Video of the Program.

gather_images.py --- Python file which when runs collects the image data captured in the box and stores it appropriately inside the category directories.

Directories:-
none, five, four, three, two, one

train.ipynb --- File used for training the deep network model.

hand-cricket-model_2.h5 ---- Mode .h5 file from the above training script.

Play2.ipynb --- Jupyter notebook file used to run the game. This extracts the above model and uses the weights to detect finger gestures.

Description


First the gather_images.py script was run and the images of the hand gestures were collected according to their categories. Categories:- None, Five, Four, Three, Two, One.

Used train.ipynb file to train the model using the images gathered from the above script. Used Squeezenet architecture for to train the model. The layers weight were frezzed except the last layer of the squeezenet. This last layer was added with additional CNN and ended with softmax activation layer to clasify the hand gestures. The dropuouts were included at 50% rate. Also AverageGlobal2D Pooling layer was added to reduce the computation speed and complexity.

Squeezenet architecture was used to reduce the complexity of computations and increase the speed of the program.

Saved the model trained as hand-cricket-model_2.h5.

Loaded the model into the Play.ipynb file and used OpenCV library to capture and classify images accordingly. The algorithm for the game is coded in this file to make the game run without any hassle.

Requirements
Tensorflow >= 1.15.0, Keras latest version

About

Created an interactive Hand-Cricket game using OpenCV python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors