Code Monkey home page Code Monkey logo

emojinator's Introduction

Emojinator ๐Ÿ––

This code helps you to recognize and classify different hand emojis

Versions ๐Ÿ—ฝ

Moved to a different Repo ๐Ÿบ

Description ๐Ÿค˜

Emojis are ideograms and smileys used in electronic messages and web pages. Emoji exist in various genres, including facial expressions, common objects, places and types of weather, and animals. They are much like emoticons, but emoji are actual pictures instead of typographics.

File Organization ๐Ÿ—„๏ธ

โ”œโ”€โ”€ Emojinator Parent (Current Directory)
    โ”œโ”€โ”€ Emojinator 
        โ”œโ”€โ”€ CreateGest.py : Create Gestures 
        โ”œโ”€โ”€ TrainEmojinator.py : Train Machine Learning model
        โ”œโ”€โ”€ Emojinator.py : Emojinator Application
        โ”œโ”€โ”€ gestures : Gesture folder
            โ”œโ”€โ”€ 0/
            โ”œโ”€โ”€ 1/
            .
            .
            .
            โ””โ”€โ”€11/
        โ””โ”€โ”€ hand_emo : hand emojis used in prediction
            โ”œโ”€โ”€ 0.png
            .
            .
            โ””โ”€โ”€ 12.png
    โ”œโ”€โ”€ Emojinator_V2 
    โ”œโ”€โ”€ LICENSE
    โ””โ”€โ”€ readme.md
        

Results ๐Ÿ“Š

๐Ÿ“Œ Cite Us

To cite this guide, use the below format:

@article{emojinator,
author = {Bahadur, Akshay},
journal = {https://github.com/akshaybahadur21/Emojinator},
month = {01},
title = {{Emojinator}},
year = {2018}
}
Made with โค๏ธ and ๐Ÿฆ™ by Akshay Bahadur

emojinator's People

Contributors

akshaybahadur21 avatar samrudh 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  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

emojinator's Issues

Index Error during keras predict class

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.

Error in creategesture

I get some error,after typing the number of the gesture

error: OpenCV(4.0.0) D:\Build\OpenCV\opencv-4.0.0\modules\imgproc\src\shapedescr.cpp:272: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::contourArea'

don't know how to solved it @@
image

error in createget.py


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'

Excellent job!

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'))

Please Help

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.

screenshot 2018-12-02 at 1 56 36 am

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'

Issue in code

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.

Training an new model

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?

LICENCE missing

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.

Issue: Saving Image

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

Error in Emojinator_V2.py (detector_utils.py), Session error

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'

Issue with running emojinator.py

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?

Program not working

Hi, I was following the procedure, I ran the CreateGest.py and entered the gesture name but no frames are getting displayed.

Error in Emojinator_V2.py (detector_utils.py), GraphDef error

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'

Error in Emojinator_V2.py (label_map_util.py)

(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'

got error in get_hand_images.py

$ 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.

Error in Creategest.py

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.

CreateGest.py and get_hand_images.py both are not working

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.

./CreateGest.py:

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):'

ValueError: invalid literal for int() with base 10: 'es\\3'

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)

Got error in CreateGest.py

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.

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.