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
- Python 3.x
- Tensorflow 1.5
- Keras
- OpenCV 3.4(for loading,resizing images)
- h5py(for saving trained model)
- pyttsx3
- A good grasp over convolutional neural networks. For online resources refer to standford cs231n, deeplearning.ai on coursera or cs231n by standford university
- A good CPU (preferably with a GPU).
- Time
- datetime
- Patience.... A lot of it.
- Start your terminal of cmd depending on your os.
- 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
- In case you do not have a GPU then use this command
pip install -r requirements_cpu.txt
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
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.
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.
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