evilport2 / sign-language Goto Github PK
View Code? Open in Web Editor NEWA very simple CNN project.
A very simple CNN project.
I'm getting com_error while running fun_util.py. While searching on the net, I found the error to be related to pyttsx3 but i'm not able to locate the exact problem. Can you help me with this??
hello sir,
This project is working fine but it's very slow.
I want to increase the layers in keras how can i do?
please help me out.
Hope for the positive response.
please respond why is my output generated vedio stream is detecting only 5 as output for any input gesture
Learned what a CNN is and how it works. Best resources were Tensorflow's official website and machinelearningmastery.net.
The website "machinelearningmastery.net" gives me a 404.
i am getting this error in flip_images.py. it runs initially then it stops when flipping the 45th gesture and shows this error. cv2.error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite'. Please revert back asap.
Sign-Language/create_gestures.py
Line 67 in df1d624
InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [47] rhs shape= [45]
[[Node: save/Assign_7 = Assign[T=DT_FLOAT, _class=["loc:@logits/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](logits/bias, save/RestoreV2:7)]]
This is the error i am getting while running cnn_tf.py
Kindly provide the solution
I'm using spyder IDE. Can I make these scripts run on double click?
i got a lot of errors. some i have fixed by i dont know what to do with the others. please help.
WARNING: Logging before flag parsing goes to stderr.
W0910 00:28:48.467671 4980 deprecation.py:506] From C:\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use rate
instead of keep_prob
. Rate should be set to rate = 1 - keep_prob
.
Traceback (most recent call last):
File "C:\Python\Python37\lib\site-packages\pydot.py", line 1915, in create
working_dir=tmp_dir,
File "C:\Python\Python37\lib\site-packages\pydot.py", line 136, in call_graphviz
**kwargs
File "C:\Python\Python37\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "C:\Python\Python37\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Python37\lib\site-packages\keras\utils\vis_utils.py", line 26, in _check_pydot
pydot.Dot.create(pydot.Dot())
File "C:\Python\Python37\lib\site-packages\pydot.py", line 1922, in create
raise OSError(*args)
FileNotFoundError: [WinError 2] "dot" not found in path.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Sign-Language-master\cnn_keras.py", line 75, in
train()
File "D:\Sign-Language-master\cnn_keras.py", line 68, in train
model, callbacks_list = cnn_model()
File "D:\Sign-Language-master\cnn_keras.py", line 47, in cnn_model
plot_model(model, to_file='model.png', show_shapes=True)
File "C:\Python\Python37\lib\site-packages\keras\utils\vis_utils.py", line 132, in plot_model
dot = model_to_dot(model, show_shapes, show_layer_names, rankdir)
File "C:\Python\Python37\lib\site-packages\keras\utils\vis_utils.py", line 55, in model_to_dot
_check_pydot()
File "C:\Python\Python37\lib\site-packages\keras\utils\vis_utils.py", line 29, in _check_pydot
'pydot
failed to call GraphViz.'
OSError: pydot
failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.
I think the images have problem. They are all black. Anyway, I get this error. Can you please help how to fix?
$ python set_hand_hist.py
OpenCV Error: Assertion failed ((scn == 3 || scn == 4) && (depth == 0 || depth == 5)) in cvtColor, file /tmp/build/80754af9/opencv_1512687413662/work/modules/imgproc/src/color.cpp, line 11115
Traceback (most recent call last):
File "set_hand_hist.py", line 70, in <module>
get_hand_hist()
File "set_hand_hist.py", line 38, in get_hand_hist
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
cv2.error: /tmp/build/80754af9/opencv_1512687413662/work/modules/imgproc/src/color.cpp:11115: error: (-215) (scn == 3 || scn == 4) && (depth == 0 || depth == 5) in function cvtColor
[jalal@goku Sign-Language]$ python
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.3.1'
flake8 testing of https://github.com/EvilPort2/Sign-Language
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
./recognize_gesture.py:32:20: F821 undefined name 'process_image'
processed_array = process_image(image)
^
./set_hand_hist.py:32:27: F821 undefined name 'imgCrop'
hsvCrop = cv2.cvtColor(imgCrop, cv2.COLOR_BGR2HSV)
^
2 F821 undefined name 'process_image'
Is the imgCrop issue related to #1 ?
this is my error:
ImportError: Could not find 'nvcuda.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Typically it is installed in 'C:\Windows\System32'. If it is not present, ensure that you have a CUDA-capable GPU with the correct driver installed.
ca you please say me what is the procedure to getrid of this error.
Hi,
Can you make a version can work on google colab?
I think it would be more convenient if it could run on google colab
Using camera on googlecolab:
https://colab.research.google.com/notebooks/snippets/advanced_outputs.ipynb#scrollTo=2viqYx97hPMi
Hi, may i know how to modify this so it can recognize dynamic sign gesture as well?
Traceback (most recent call last):
File "C:/Users/ankit/PycharmProjects/SLSWithVoice1/Sign-Language-master/cnn_tf.py", line 114, in
tf.compat.v1.app.run()
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\absl\app.py", line 303, in run
_run_main(main, args)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "C:/Users/ankit/PycharmProjects/SLSWithVoice1/Sign-Language-master/cnn_tf.py", line 101, in main
classifier.train(input_fn=train_input_fn, hooks=[logging_hook])
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 349, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1175, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1204, in _train_model_default
self.config)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1163, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:/Users/ankit/PycharmProjects/SLSWithVoice1/Sign-Language-master/cnn_tf.py", line 26, in cnn_model_fn
name="conv1")
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\keras\legacy_tf_layers\convolutional.py", line 437, in conv2d
return layer.apply(inputs)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\keras\engine\base_layer_v1.py", line 1722, in apply
return self.call(inputs, *args, **kwargs)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\keras\legacy_tf_layers\base.py", line 551, in call
outputs = super(Layer, self).call(inputs, *args, **kwargs)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\keras\engine\base_layer_v1.py", line 786, in call
outputs = call_fn(cast_inputs, *args, **kwargs)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 667, in wrapper
return converted_call(f, args, kwargs, options=options)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 396, in converted_call
return _call_unconverted(f, args, kwargs, options)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 478, in _call_unconverted
return f(*args, **kwargs)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\keras\layers\convolutional.py", line 248, in call
outputs = self._convolution_op(inputs, self.kernel)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper
return target(*args, **kwargs)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1020, in convolution_v2
name=name)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1150, in convolution_internal
name=name)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 2604, in _conv2d_expanded_batch
name=name)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 972, in conv2d
data_format=data_format, dilations=dilations, name=name)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 630, in _apply_op_helper
param_name=input_name)
File "C:\Users\ankit\PycharmProjects\SLSWithVoice1\venv\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 63, in _SatisfiesTypeConstraint
", ".join(dtypes.as_dtype(x).name for x in allowed_list)))
TypeError: Value passed to parameter 'input' has DataType uint8 not in list of allowed values: float16, bfloat16, float32, float64, int32
I want to delete some of the gestures from the database. How to go about it?
I am getting EOF Error in loading hist pickle in file recognize_gesture.py at line 84
Traceback (most recent call last):
File "create_gestures.py", line 106, in
store_images(g_id)
File "create_gestures.py", line 70, in store_images
contour = max(contours, key = cv2.contourArea(contours[0]))
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:274: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::contourArea'
Do you have any idea about this error ? I tried googling it but there was no solution.
what python version is this? Is opencv capable for 3.7?
hi, when I try to press 'c' in the create_gesture.py is wont create the gesture
what can I do?
I managed to replace the gesture using create_gestures.py but I'm not able to change the text/gesture name corresponding to it.
Also, how do I edit the .db file?
Hi,
I've been trying to run the python files on my mac but every time I face the same error.
File "create_gestures.py", line 64, in store_images
imgCrop = img[y:y+h, x:x+w]
File "fun_util.py", line 53, in recognize
imgCrop = img[y:y+h, x:x+w]
TypeError: 'NoneType' object is not subscriptable
File "recognize_gesture.py", line 96, in recognize
imgCrop = img[y:y+h, x:x+w]
TypeError: 'NoneType' object is not subscriptable
What do you think might be the issue
When I try to execute fun_util.py I got this error:
2018-09-01 14:37:38.758942: F T:\src\github\tensorflow\tensorflow\core\kernels\conv_ops.cc:712] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo(), &algorithms)
It shows only 'o' as output for every gesture.
i need your help to work on RPI 3
this error
contour = max(contours, key = cv2.contourArea)
cv2.error: /build/opencv-L65chJ/opencv-3.2.0+dfsg/modules/imgproc/src/shapedescr.cpp:320: error: (-215) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function contourArea
i am getting the following and yes there is no file and how is the code getting executed for u??
C:\Users\HP\Desktop\Sign-Language-master>python cnn_tf.py
Traceback (most recent call last):
File "cnn_tf.py", line 114, in
tf.app.run()
File "C:\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 124, in run
_sys.exit(main(argv))
File "cnn_tf.py", line 84, in main
with open("train_images", "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'train_images'
I am trying to run the file fun_util.py
However, the following Error Message appears:
Using TensorFlow backend.
Traceback (most recent call last):
File "/xxx/Sign-Language-master-2/fun_util.py", line 317, in
recognize()
File "/xxx/Sign-Language-master-2/fun_util.py", line 310, in recognize
keypress = text_mode(cam)
File "/xxx/Sign-Language-master-2/fun_util.py", line 284, in text_mode
res = np.hstack((img, blackboard))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/shape_base.py", line 288, in hstack
return _nx.concatenate(arrs, 1)
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Since I am a beginner trying to learn, I can't figure out what's happening.
May anyone helps? Thanks.
hi,
when i run create_gestures.py,i meet that
cv2.error: /build/opencv-SviWsf/opencv-2.4.9.1+dfsg/modules/imgproc/src/contours.cpp:1904: error: (-215) contour.checkVector(2) >= 0 && (contour.depth() == CV_32F || contour.depth() == CV_32S) in function contourArea
what is the wrong?
checkpoint1 = ModelCheckpoint(filepath, monitor='val_acc', verbose=1, save_best_only=True, mode='max')
to be changed to
checkpoint1 = ModelCheckpoint(filepath, monitor='val_accuracy', verbose=1, save_best_only=True, mode='max')
When I run the cnn_keras.py file in Visual studio, I get this error,
ValueError: Error when checking target: expected dense_2 to have shape (2,) but got array with shape (3,)
(TF - 1.15.2 / keras 2.2.4)
Please help me to solve this.
Traceback (most recent call last):
File "create_gestures.py", line 106, in
store_images(g_id)
File "create_gestures.py", line 70, in store_images
contour = max(contours, key = cv2.contourArea(contours[0]))
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:274: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::contourArea'
Do you have any idea about this error ? I tried google it but there was no solution.
I'm getting com_error while running fun_util.py. While searching on the net, I found the error to be related to pyttsx3 but i'm not able to locate the exact problem. Can you help me with this??
$ python3 recognize_gesture.py
Traceback (most recent call last):
File "recognize_gesture.py", line 4, in
from cnn_tf import cnn_model_fn
File "C:\Users\REDACTED\Desktop\Sign-Language-master\cnn_tf.py", line 5, in
tf.logging.set_verbosity(tf.logging.INFO)
AttributeError: module 'tensorflow' has no attribute 'logging'
When I try to run recognize_gestures.py or fun_util.py. I get this error. I'm assuming I installed some packages via pip incorrectly. I don't know how to fix this. Could anyone please help me, Thank you.
Using TensorFlow backend.
[ WARN:0] videoio(MSMF): can't grab frame. Error: -2147483638
[ WARN:1] terminating async callback
Traceback (most recent call last):
File "recognize_gesture.py", line 140, in
recognize()
File "recognize_gesture.py", line 110, in recognize
if len(contours) > 0:
TypeError: object of type 'NoneType' has no len()
[ WARN:0] terminating async callback
Sign-Language/create_gestures.py
Line 67 in df1d624
Traceback (most recent call last):
File "D:\Azhari\Tugas Akhir-2\Tunarungu\cnn_tf.py", line 114, in
tf.app.run()
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "D:\Azhari\Tugas Akhir-2\Tunarungu\cnn_tf.py", line 85, in main
train_images = np.array(pickle.load(f))
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
im using numpy 1.15
opencv 3.4
tenserflow 1.4
keras 2.0.0
thanks
Traceback (most recent call last):
File "cnn_keras.py", line 75, in
train()
File "cnn_keras.py", line 63, in train
train_labels = np_utils.to_categorical(train_labels)
File "/usr/local/lib/python2.7/dist-packages/keras/utils/np_utils.py", line 31, in to_categorical
num_classes = np.max(y) + 1
File "/usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 2505, in amax
initial=initial)
File "/usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity
Traceback (most recent call last):
File "cnn_keras.py", line 17, in
K.set_image_dim_ordering('tf')
AttributeError: module 'keras.backend' has no attribute 'set_image_dim_ordering'
Cv2 error (-215) something
Gesture_Recognition_Final.zip
cnn_model_keras1.h5 is the file that you have given
cnn_model_keras2.h5 is the file that I have generated from my model
Getting Error:
return _nx.concatenate(arrs, 1)
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Please help with this issue
I faced this problem. Tried to change set_image_dim_ordering to set_image_data_format but the problem didn't solve. Please kindly advice me. Thank you.
C:\Users\user\Desktop\Sign-Language-master>python cnn_keras.py
Using TensorFlow backend.
2019-12-07 08:35:59.719620: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
Traceback (most recent call last):
File "cnn_keras.py", line 15, in
K.set_image_dim_ordering('tf')
AttributeError: module 'keras.backend' has no attribute 'set_image_dim_ordering'
Hi I m running with the file fun_util.py
However, the following Error occurs:
Using TensorFlow backend.
Traceback (most recent call last):
File "/xxx/Sign-Language-master-2/fun_util.py", line 317, in
recognize()
File "/xxx/Sign-Language-master-2/fun_util.py", line 310, in recognize
keypress = text_mode(cam)
File "/xxx/Sign-Language-master-2/fun_util.py", line 284, in text_mode
res = np.hstack((img, blackboard))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/shape_base.py", line 288, in hstack
return _nx.concatenate(arrs, 1)
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Since I am a beginner learning this, I can't figure what's happening.
May you please help? Thank you.
Everything is working fine without any error byt whatever the gesture is given as input the outpput is always 5 ,what to do to get the correct output,even the accuracy of the model displayed during training is 0.0224 pls help me!
Bro, Please Solve cnn_tf to tensorflow version 2.0
and fix the error
classifier.train(input_fn=train_input_fn, hooks=[logging_hook]):
TypeError: Value passed to parameter 'input' has DataType uint8 not in list of allowed values: float16, bfloat16, float32, float64, int32
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.