← 开源
EvilPort2

Sign-Language

A very simple CNN project to recognize gestures made in American Sign Language

TutorialsML/AI fundamentals
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
826
Star
357
Fork
+-1
本周
4
贡献者
创建于 2018-02-19 · 更新于 2026-10-12 · 今日第 13422 名
主要开发者
EvilPort2bytesByHarshshardul08

EvilPort2/Sign-Language 排名第 13,422,有 826 个星标。

同类别比较

EvilPort2/Sign-Language 排名第 13,422,此处有 8 个同类条目;NVIDIA/TileGym 排名第 13,423。

同类别比较
名称排名指标
databricks-academy/large-language-models13,385
语言:
Python
星标数:
830
分叉数:
465
简介:
Notebooks for Large Language Models (LLMs) Specialization
firecrawl/firecrawl-app-examples13,398
语言:
Jupyter Notebook
星标数:
829
分叉数:
213
简介:
🔥 This repository contains complete application examples, including websites and other projects, developed using Firecrawl.
Machine-Learning-Tokyo/papers-with-annotations13,413
星标数:
827
分叉数:
75
简介:
Research papers with annotations, illustrations and explanations
jingtian11/EasyOffer13,418
语言:
Jupyter Notebook
星标数:
827
分叉数:
56
简介:
《EasyOffer》(<大模型面经合集>)是针对LLM宝宝们量身打造的大模型暑期实习Offer指南,主要记录大模型暑期实习和秋招准备的一些常见大厂手撕代码、大厂面经经验、常见大厂思考题等;小白一个,正在学习ing......有问题各位大佬随时指正,希望大家都能拿到心仪Offer!
NVIDIA/TileGym13,423
语言:
Python
星标数:
826
分叉数:
92
简介:
Helpful kernel tutorials, examples and SKILLs for tile-based GPU programming
wenxinxu/resnet-in-tensorflow13,440
语言:
Python
星标数:
825
分叉数:
274
简介:
Re-implement Kaiming He's deep residual networks in tensorflow. Can be trained with cifar10.
LambdaLabsML/examples13,442
语言:
Jupyter Notebook
星标数:
824
分叉数:
105
简介:
Deep Learning Examples
mbeyeler/opencv-machine-learning13,467
语言:
Jupyter Notebook
星标数:
822
分叉数:
442
简介:
M. Beyeler (2017). Machine Learning for OpenCV: Intelligent image processing with Python. Packt Publishing Ltd., ISBN 978-178398028-4.
关键参数与规格
关键参数与规格
参数值
类别Tutorials
子类别ML/AI fundamentals
星标数826
分叉数357
贡献者4
创建日期2018-02-19
更新日期2026-10-12
1 天星标数0
7 天星标数-1
排名13,422
上次排名13,322
排名变化-100
7 天星标排名17,544
上次 7 天星标排名17,500
7 天星标排名变化-44
总星标排名12,983
上次总星标排名12,963
总星标排名变化-20
README 摘录

Sign-Language A very simple CNN project. Note Simple-OpenCV-Calculator and this project are merged to one. Simple-OpenCV-Calculator will no longer be maintained. The first thing I did was, I created 44 gesture samples using OpenCV. For each gesture I captured 1200 images which were 50x50 pixels. All theses images were in grayscale which is stored in the gestures/ folder. The pictures were flipped using flip_images. This script flips every image along the vertical axis. Best

resources were Tensorflow's official website and machinelearningmastery. Created a CNN which look a lot similar to this MNIST classifying model using both Tensorflow and Keras. If you want to add more gestures you might need to add your own layers and also tweak some parameters, that you have to do on your own. Then used the model which was trained using Keras on a video stream. As of today, I have stored the 44 gestures for which are 26 alphabets

and 10 numbers of American Sign language and some other gestures. A good grasp over the above 5 topics along with neural networks. Refer to the internet if you have problems with those. 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). In case you do not have a GPU then use this command How to use this repo

Before using this repo, let me warn about something. You will have no interactive interface that will tell you what to do. So you will have to figure out most of the stuff by yourself and also make some changes to the scripts if the needs arise. Watch the video guide for setting the hand histogram here . You do not need to do it again if you have already done it. But you do need to do it if the

lighting conditions change. To do so type the command given below and follow the instructions below. A windows "Set hand histogram" will appear. "Set hand histogram" will have 50 squares (5x10). Make sure your hand covers all the squares. On pressing 'c' only white patches corresponding to the parts of the image which has your skin color should appear on the "Thresh" window. Make sure all the squares are covered by your hand. In case you are not successful then

move your hand a little bit and press 'c' again. Repeat this until you get a good histogram. After you get a good histogram press 's' to save the histogram. I already have added 44 (0-43) gestures. It is on you if you want to add even more gestures or replace my gestures. To create your own gestures or replace my gestures do the following. On starting executing this program, you will have to enter the gesture number and

gesture name/text. Then an OpenCV window called "Capturing gestures" which will appear. In the webcam feed you will see

常见问题

记录了多少星标和分叉?

EvilPort2/Sign-Language 有 826 个星标和 357 个分叉。

仓库排名是多少?

EvilPort2/Sign-Language 排名第 13,422。

哪个仓库排名最接近?

EvilPort2/Sign-Language 与 NVIDIA/TileGym 比较,后者排名第 13,423,有 826 个星标。

README

Sign-Language

A very simple CNN project.

Note

Simple-OpenCV-Calculator and this project are merged to one. Simple-OpenCV-Calculator will no longer be maintained.

What I did here

  1. The first thing I did was, I created 44 gesture samples using OpenCV. For each gesture I captured 1200 images which were 50x50 pixels. All theses images were in grayscale which is stored in the gestures/ folder. The pictures were flipped using flip_images.py. This script flips every image along the vertical axis. Hence each gesture has 2400 images.
  2. Learned what a CNN is and how it works. Best resources were Tensorflow's official website and machinelearningmastery.com.
  3. Created a CNN which look a lot similar to this MNIST classifying model using both Tensorflow and Keras. If you want to add more gestures you might need to add your own layers and also tweak some parameters, that you have to do on your own.
  4. Then used the model which was trained using Keras on a video stream.
  5. As of today, I have stored the 44 gestures for which are 26 alphabets and 10 numbers of American Sign language and some other gestures. And trained the model on these images.

There are a lot of details that I left. But these are the basic and main steps.

Outcome

Watch it here.

Requirements

  1. Python 3.x
  2. Tensorflow 1.5
  3. Keras
  4. OpenCV 3.4
  5. h5py
  6. pyttsx3
  7. A good grasp over the above 5 topics along with neural networks. Refer to the internet if you have problems with those. I myself am just a begineer in those.
  8. A good CPU (preferably with a GPU).
  9. Patience.... A lot of it.

Installing the requirements

  1. Start your terminal of cmd depending on your os.
  2. 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
  1. In case you do not have a GPU then use this command
pip install -r requirements_cpu.txt

How to use this repo

Before using this repo, let me warn about something. You will have no interactive interface that will tell you what to do. So you will have to figure out most of the stuff by yourself and also make some changes to the scripts if the needs arise. But here is a basic gist.

Creating a gesture

  1. Watch the video guide for setting the hand histogram here.
  2. First set your hand histogram. You do not need to do it again if you have already done it. But you do need to do it if the lighting conditions change. To do so type the command given below and follow the instructions below.
python set_hand_hist.py
  • A windows "Set hand histogram" will appear.
  • "Set hand histogram" will have 50 squares (5x10).
  • Put your hand in those squares. Make sure your hand covers all the squares.
  • Press 'c'. 1 other window will appear "Thresh".
  • On pressing 'c' only white patches corresponding to the parts of the image which has your skin color should appear on the "Thresh" window.
  • Make sure all the squares are covered by your hand.
  • In case you are not successful then move your hand a little bit and press 'c' again. Repeat this until you get a good histogram.
  • After you get a good histogram press 's' to save the histogram. All the windows close.
  1. I already have added 44 (0-43) gestures. It is on you if you want to add even more gestures or replace my gestures. Hence this step is OPTIONAL. To create your own gestures or replace my gestures do the following. It is done by the command given below. On starting executing this program, you will have to enter the gesture number and gesture name/text. Then an OpenCV window called "Capturing gestures" which will appear. In the webcam feed you will see a green window (inside which you will have to do your gesture) and a counter that counts the number of pictures stored.
python create_gestures.py   
  1. Press 'c' when you are ready with your gesture. Capturing gesture will begin after a few seconds. Move your hand a little bit here and there. You can pause capturing by pressing 'c' and resume it by pressing 'c'. Capturing resumes after a few secondAfter the counter reaches 1200 the window will close automatically.

After capturing all the gestures you can flip the images using

python flip_images.py
  1. When you are done adding new gestures run the load_images.py file once. You do not need to run this file again until and unless you add a new gesture.
python load_images.py

Displaying all gestures

  1. To see all the gestures that are stored in 'gestures/' folder run this command
python display_all_gestures.py

Training a model

  1. So training can be done with either Tensorflow or Keras. If you want to train using Tensorflow then run the cnn_tf.py file. If you want to train using Keras then use the cnn_keras.py file.
python cnn_tf.py
python cnn_keras.py
  1. If you use Tensorflow you will have the checkpoints and the metagraph file in the tmp/cnn_model3 folder.
  2. If you use Keras you will have the model in the root directory by the name cnn_model_keras2.h5.

You do not need to retrain your model every time. In case you added or removed a gesture then you need to retrain it.

Get model reports

  1. To get the classification reports about the model make sure you have test_images and test_labels file which are generated by load_images.py. In case you do not have them run load_images.py file again. Then run this file
python get_model_reports.py
  1. You will get the confusion matrix, f scores, precision and recall for the predictions by the model.

Testing gestures

Before going into much details I would like to tell that I was not able to use the model trained using tensorflow. That is because I do not know how to use it. I tried using the predict() function of the Estimator API but that loads the parameters into memory every time it is called which is a huge overhead. Please help me if you can with this. The functions for prediction using tf is tf_predict() which you will find in the recognize_gesture.py file but it is never used. This is why I ended up using Keras' model, as the loading the model into memory and using it for prediction is super easy.

  1. First set your hand histogram. 0. Watch the video guide for setting the hand histogram here. You do not need to do it again if you have already done it. But you do need to do it if the lighting conditions change. To do so type the command given below and follow the instructions below.
python set_hand_hist.py
  • A windows "Set hand histogram" will appear.
  • "Set hand histogram" will have 50 squares (5x10).
  • Put your hand in those squares. Make sure your hand covers all the squares.
  • Press 'c'. 1 other window will appear "Thresh".
  • On pressing 'c' only white patches corresponding to the parts of the image which has your skin color should appear on the "Thresh" window.
  • Make sure all the squares are covered by your hand.
  • In case you are not successful then move your hand a little bit and press 'c' again. Repeat this until you get a good histogram.
  • After you get a good histogram press 's' to save the histogram. All the windows close.
  1. For recognition start the recognize_gesture.py file.
python recognize_gesture.py
  1. You will have a small green box inside which you need to do your gestures.

Using fun_util.py

Here is where you will have all the fun.

  1. First set your hand histogram. You do not need to do it again if you have already done it. But you do need to do it if the lighting conditions change. To do so type the command given below and follow the instructions below.
python set_hand_hist.py
  • A windows "Set hand histogram" will appear.
  • "Set hand histogram" will have 50 squares (5x10).
  • Put your hand in those squares.
  • Press 'c'. 2 other windows will appear. "res" and "Thresh".
  • On pressing 'c' only the parts of the image which has your skin color should appear on the "res" window. White patches corresponding to this should appear on the "Thresh" window.
  • In case you are not successful then move your hand a little bit and press 'c' again. Repeat this until you get a good histogram.
  • After you get a good histogram press 's' to save the histogram. All the windows close.
  1. Start the file.
python fun_util.py

Text Mode (Press 't' to go to text mode)

  1. In text mode you can create your own words using fingerspellings or use the predefined gestures.
  2. The text on screen will be converted to speech on removing your hand from the green box
  3. Make sure you keep the same gesture on the green box for 15 frames or else the gesture will not be converted to text.

Calculator Mode (Press 'c' to go to calculator mode)

  1. To confirm a digit make sure you keep the same gesture for 20 frames. On successful confirmation, the number will appear in the vertical center of the black part of the window.
  2. To confirm a number make the "best of luck" gesture and keep in the green box for 25 frames. You will get used to the timing :P.
  3. You can have any number of digits for both first number and second number.
  4. Currently there are 10 operators.
  5. During operator selection, 1 means '+', 2 means '-', 3 means '*', 4 means '/', 5 means '%', 6 means '**', 7 means '>>' or right shift operator, 8 means '<<' or left shift operator, 9 means '&' or bitwise AND and 0 means '|' or bitwise OR.

Got a question?

If you have any questions that are bothering you please contact me on my facebook profile. Just do not ask me questions like where do I live, who do I work for etc. Also no questions like what does this line do. If you think a line is redundant or can be removed to make the program better then you can obviously ask me or make a pull request.

How to cite

Saha, D.. (2018, May 9). Sign-Language (Version 1). figshare. https://doi.org/10.6084/m9.figshare.6241901.v1A very simple CNN project.

排名相邻
同类项目