akshaybahadur21 / emojinator Goto Github PK
View Code? Open in Web Editor NEWA simple emoji classifier for humans. ๐
License: MIT License
A simple emoji classifier for humans. ๐
License: MIT License
The same code gives a few errors.
The first one is that mkdir command doesn't work as intended.
The second one is the contour function of cv2. It doesn't launch the camera also.
Hi, CreateGest.py and get_hand_images.py both are not working for me. even after videocapture(0) it is not able to start camera. I tried playing with while loop then it started camera, but as i am new to python and ML both i was not able to successfully execute it.
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:274:
i am getting following index error while running emojinator.py:
IndexError Traceback (most recent call last)
in
----> 1 main()
in main()
28 pred_probab, pred_class = keras_predict(model, newImage)
29 print(pred_class, pred_probab)
---> 30 img = overlay(img, emojis[pred_class], 400, 250, 90, 90)
31
32 x, y, w, h = 300, 50, 350, 350
IndexError: list index out of range
what i am doing wrong? any solution?
Sir,
Everything is fine but the images are not saving in the given path. And, also can we convert the code into an application? Kindly help me to resolve this issue.
Sohana Tarafder
Traceback (most recent call last):
File "Emojinator_V2.py", line 10, in
detection_graph, sess = detector_utils.load_inference_graph()
File "D:\1Downloads\Emojinator-master (1)\Emojinator-master\Emojinator_V2\utils\detector_utils.py", line 40, in load_inference_graph
od_graph_def = tf.GraphDef()
AttributeError: module 'tensorflow' has no attribute 'GraphDef'
When i am executing CreateGest.py I was getting this error
File "CreateGest.py", line 42, in main
if len(contours) > 0:
TypeError: object of type 'NoneType' has no len()
[ WARN:0] terminating async callback
[ WARN:0] terminating async callback
Please help me in solving this. Thanks in advance.
Is this code available under terms of some open source licence?? I want to use it for some of my own projects so if you can add a LICENCE it would be great.
By default, 'file' is written in the MIFF image format. To
specify a particular image format, precede the filename with an image
format name and a colon (i.e. ps:image) or specify the image type as
the filename suffix (i.e. image.ps). Specify 'file' as '-' for
standard input or output.
import: delegate library support not built-in '' (X11) @ error/import.c/ImportImageCommand/1297.
./CreateGest.py: line 5: image_x,: command not found
./CreateGest.py: line 7: syntax error near unexpected token (' ./CreateGest.py: line 7:
cap = cv2.VideoCapture(0):'
I am using Terminal for all python programming.
successfully executed first 2 files but ran into an error when tried running "TrainEmojinator.py".
This is the error I encountered.
Please Help.
Using TensorFlow backend.
number of training examples = 1199
number of test examples = 0
X_train shape: (1199, 2500)
Y_train shape: (1, 1199)
X_test shape: (0, 2500)
Y_test shape: (1, 0)
Traceback (most recent call last):
File "TrainEmojinator.py", line 82, in
main()
File "TrainEmojinator.py", line 63, in main
train_y = np_utils.to_categorical(Y_train)
File "/Users/Saransh/anaconda2/lib/python2.7/site-packages/keras/utils/np_utils.py", line 23, in to_categorical
y = np.array(y, dtype='int')
ValueError: invalid literal for long() with base 10: 'es/1'
Hello @akshaybahadur21 ,
so amazing.
I am a little bit interested that how to make use of your uploaded model in hand_detection_inference_graph.
Could you show me the detailed steps? thanks a lot.
Best Regards,
kingaza
$ python3.6 get_hand_images.py
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
Unable to stop the stream: Device or resource busy
VIDEOIO ERROR: V4L: can't open camera by index 0
Traceback (most recent call last):
File "get_hand_images.py", line 28, in
main()
File "get_hand_images.py", line 22, in main
cv2.imshow("Capturing gesture", frame)
cv2.error: OpenCV(3.4.3) /io/opencv/modules/highgui/src/window.cpp:356: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
Maybe I missed something or version related problem. Could you please help me?
Thanks in advance.
Excellent job ! ๐
Could you please tell me why you design network like this?
What's your purpose when you add each layer?
model.add(Conv2D(32, (5, 5), input_shape=(image_x, image_y, 1), activation='relu')) model.add(MaxPooling2D(pool_size=(2, 2), strides=(2, 2), padding='same')) model.add(Conv2D(64, (5, 5), activation='sigmoid')) model.add(MaxPooling2D(pool_size=(5, 5), strides=(5, 5), padding='same')) model.add(Flatten()) model.add(Dense(1024, activation='relu')) model.add(Dropout(0.6)) model.add(Dense(num_of_classes, activation='softmax'))
(myenv1) D:\1Downloads\Emojinator-master (1)\Emojinator-master\Emojinator_V2>python Emojinator_V2.py
2021-11-24 15:52:31.974645: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last):
File "Emojinator_V2.py", line 1, in
from utils import detector_utils as detector_utils
File "D:\1Downloads\Emojinator-master (1)\Emojinator-master\Emojinator_V2\utils\detector_utils.py", line 28, in
label_map = label_map_util.load_labelmap(PATH_TO_LABELS)
File "D:\1Downloads\Emojinator-master (1)\Emojinator-master\Emojinator_V2\utils\label_map_util.py", line 116, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
Hi, I was following the procedure, I ran the CreateGest.py and entered the gesture name but no frames are getting displayed.
When I'm running the code this comes.
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:315: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::contourArea'
please help to rectify it.
error Traceback (most recent call last)
in ()
76
77 g_id = input("Enter gesture number: ")
---> 78 main(g_id)
in main(g_id)
27 ret, frame = cap.read()
28 frame = cv2.flip(frame, 1)
---> 29 hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
30
31 mask2 = cv2.inRange(hsv, np.array([2, 50, 60]), np.array([25, 150, 255]))
error: OpenCV(3.4.2) /io/opencv/modules/imgproc/src/color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'CvtHelper'
What changes I need to make in the TrainEmojinator.py file for training a new model with a different number of classes and a different number of training images?
I am trying to clone and it is taking forever.
I just want to download and it is taking forever - there is a folder with lots of images and that's holding up the cloning .
I liked your project and following it. Trying to see how you are doing it using the CNN.
Emojinator v2 is apparently not writing. Have imported the cv2 module but the problem perseus.
Traceback (most recent call last):
File "Emojinator_V2.py", line 10, in
detection_graph, sess = detector_utils.load_inference_graph()
File "D:\1Downloads\Emojinator-master (1)\Emojinator-master\Emojinator_V2\utils\detector_utils.py", line 45, in load_inference_graph
sess = tf.Session(graph=detection_graph)
AttributeError: module 'tensorflow' has no attribute 'Session'
Hello sir,
I'm trying this code. I had used 10 gestures and in hand_emo folder uploaded 11 photos. Whenever m trying to execute main program of emojinator final program in which we are overlaying images I'm getting error in line
img=overlay(img,emojis[predict_class],400,300,350,350)
The error is: list index out of range
I trid printing values of predict_class which is 15 and emojis is from 0-10. Is this error due to mismatch in these values. Also kindly explain me how predict class is calculated.
I tried to reduce classes to 6. Changed num_of_classes in TrainEmojinator.py. Also removed gestures from 7 to 12
However getting below error while training the model:
y = np.array(y, dtype='int')
ValueError: invalid literal for int() with base 10: 'es\3'
In main function:
main()
File ".\TrainEmojinator.py", line 61, in main
train_y = np_utils.to_categorical(Y_train)
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.