Giter Site home page Giter Site logo

sparshasaha / hand-gesture-recognition-using-background-elllimination-and-convolution-neural-network Goto Github PK

View Code? Open in Web Editor NEW
141.0 141.0 58.0 201.09 MB

Hand Gesture Recognition using Convolution Neural Network built using Tensorflow, OpenCV and python

License: MIT License

Jupyter Notebook 36.84% Python 63.16%
convolutional-neural-networks deep-learning foreground-detection hand-gesture-recognition open-cv supervised-learning

hand-gesture-recognition-using-background-elllimination-and-convolution-neural-network's People

Contributors

mohammed-emad avatar sparshasaha 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

hand-gesture-recognition-using-background-elllimination-and-convolution-neural-network's Issues

network structure

Hello, I have a question about the network structure. Why design seven hidden layers? That sounds a bit too much. I calculated that if the input is 89x100, then the output of Layer 6 convolution layer is 1x1, then what about Layer 7? I am a beginner, so the questions are very basic. I hope you can answer them. Thank you.

[Training Phase] cannot reshape array of size 107100 into shape (89,100,1)

While trying to play around with the .ipynb, I get the following error

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-a59e65dd974e> in <module>
     17     image = cv2.imread('Dataset/FistTest/fist_' + str(i) + '.png')
     18     gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
---> 19     testImages.append(gray_image.reshape(89, 100, 1))
     20 
     21 testLabels = []

ValueError: cannot reshape array of size 107100 into shape (89,100,1)

The only thing that I'm doing, just to play around, is to modify the network's structure to this

convnet=input_data(shape=[None,89,100,1],name='input')
convnet=conv_2d(convnet,32,2,activation='relu')
convnet=max_pool_2d(convnet,2)
convnet=conv_2d(convnet,64,2,activation='relu')
convnet=max_pool_2d(convnet,2)

#convnet=conv_2d(convnet,128,2,activation='relu')
#convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,256,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,256,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,128,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,64,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=fully_connected(convnet,1000,activation='relu')
convnet=dropout(convnet,0.75)

convnet=fully_connected(convnet,3,activation='softmax')

convnet=regression(convnet,optimizer='adam',learning_rate=0.001,loss='categorical_crossentropy',name='regression')

model=tflearn.DNN(convnet,tensorboard_verbose=0)

But the crashing point is called before the network's inizialization so I can't get, honestly, what's going wrong :/

New Gesture Dataset

I added my custom data set and trained the model also but when i add new lines in ContinuousGesturePredictor.py , it gives an error.

def getPredictedClass():
# Predict
image = cv2.imread('Temp.png')
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
prediction = model.predict([gray_image.reshape(89, 100, 1)])
return np.argmax(prediction), (np.amax(prediction) / (prediction[0][0] + prediction[0][1] + prediction[0][2] + prediction[0][3]))

def showStatistics(predictedClass, confidence):

textImage = np.zeros((300,512,3), np.uint8)
className = ""

if predictedClass == 0:
    className = "Swing"
elif predictedClass == 1:
    className = "Palm"
elif predictedClass == 2:
    className = "Fist"
elif predictedClass == 3:
    className = "One"

Help pls!!

new dataset

i am trying to create dataset for peace sign. But new threshold images are not saved in my PeaceTest folder even after i changed code in line 103

problem sloved

Version?

What version of TensorFlow and tflearn are you using?

ValueError: The passed save_path is not a valid checkpoint

C:\Users\adeebx1\Documents\GitHub\Hand-Gesture-Recognition-Using-Background-Elllimination-and-Convolution-Neural-Network>ContinuousGesturePredictor.py
curses is not supported on this machine (please install/reinstall curses for an optimal experience)
WARNING:tensorflow:From C:\Users\adeebx1\AppData\Local\Programs\Python\Python36\lib\site-packages\tflearn\initializations.py:119: UniformUnitScaling.init (from tensorflow.python.ops.init_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.initializers.variance_scaling instead with distribution=uniform to get equivalent behavior.
WARNING:tensorflow:From C:\Users\adeebx1\AppData\Local\Programs\Python\Python36\lib\site-packages\tflearn\objectives.py:66: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
Traceback (most recent call last):
File "C:\Users\adeebx1\Documents\GitHub\Hand-Gesture-Recognition-Using-Background-Elllimination-and-Convolution-Neural-Network\ContinuousGesturePredictor.py", line 206, in
model.load("GestureRecogModel.tfl")
File "C:\Users\adeebx1\AppData\Local\Programs\Python\Python36\lib\site-packages\tflearn\models\dnn.py", line 308, in load
self.trainer.restore(model_file, weights_only, **optargs)
File "C:\Users\adeebx1\AppData\Local\Programs\Python\Python36\lib\site-packages\tflearn\helpers\trainer.py", line 490, in restore
self.restorer.restore(self.session, model_file)
File "C:\Users\adeebx1\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 1538, in restore
+ compat.as_text(save_path))
ValueError: The passed save_path is not a valid checkpoint: C:\Users\adeebx1\Documents\GitHub\Hand-Gesture-Recognition-Using-Background-Elllimination-and-Convolution-Neural-Network\GestureRecogModel.tfl

how to solve this issue!!

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.