Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 2.33 KB

File metadata and controls

52 lines (41 loc) · 2.33 KB

stone_paper_scissor_defeator_using_opencv_keras

In this repository i tried to replicate a cool project by a japanese scientist who made a machine which had 100 % accuracy in defeating humans in the game of stone-paper and scissors using convolutional neural networks and computer vision i have used opencv for computer vision and keras for CNNS link to video tutorial https://www.youtube.com/watch?v=ecSDKWkktOw

Requirements

  1. Python 3.x
  2. Tensorflow 1.5
  3. Keras
  4. OpenCV 3.4(for loading,resizing images)
  5. h5py(for saving trained model)
  6. pyttsx3
  7. A good grasp over convolutional neural networks. For online resources refer to standford cs231n, deeplearning.ai on coursera or cs231n by standford university
  8. A good CPU (preferably with a GPU).
  9. Time
  10. datetime
  11. Patience.... A lot of it.

Installing the requirements

  1. Start your terminal of cmd depending on your os.
  2. If you have a NVidia GPU then make sure you have the prerequisites for Tensorflow GPU installation (Refer to official site). Then use this commmand
pip install -r requirements_gpu.txt
  1. In case you do not have a GPU then use this command
pip install -r requirements_cpu.txt

Steps for making your own trainig data

Place the camera and don't move it, As soon as the camera starts, perform only one gesture at a time, the numberred images of this gesture will be stored in the root directory(you can modify the code append the path to which ever directory you want) Gather data for all the classes in the similar way

Training your own classifier

I used my own laptop for training puproses but you can use aws, google collab, azure ........ For training
1)Modify the path of the stone,paper and scissor folder in hand_gesture_creating_model.py
2)Run hand_gesture_creating_model.py
After the model is trained you are ready to run it.

Running the trained model

1)Modify the path to the model file in predicting.py
2)Run predicting.py

Congratulations you just made your very own MAN defeating machine.

Liked it

Give the repository a star if you really liked it.
if you have any doubts, you can comment them under my youtube video or you can post your doubts on my facebook page REACTOR SCIENCE
Thank you