# Hand Gesture Recognition (Perceptron and CNN)
Goal is to recognize hand gestures. I've trained the model on my own dataset using *Perceptron* (and *CNN* thereafter). I've included my dataset in the repository itself. In it's present state the model is trained to recognize just two (now four) gestures (please see the *CNN* implementation section in this readme, I trained it for 4 gestures afterwards) but can easily be trained for many hand gestures.
I'll also upload the code that I'm using for capturing the hand an processing it for training the model.
Model gives a high testing accuracy of about **99%** using just two *Dense* layers. But if you want to train more hand gestures then you'll probably need more a complex network.
Images in the dataset are of dimension *200 by 200*. But for performance reasons they have been resized to *50 by 50*. You can use them as it is if you have a powerful setup otherwise program displays a Tensorflow error
`tensorflow/core/framework/allocator.cc:101] Allocation of X exceeds 10% of system memory.`
## What's in the Repository
* `captureHand.py` - This program can capture new hand gestures and write them in the specified directory
* `recognizer.py` - This is the main program that uses pretrained model (in the repo) for recognizing hand gestures
* `trainer.py` - This program uses the given dataset to train the Perceptron model
* `modelWeights.h5` - Weights for the Perceptron model
* `trainedModel.json` - JSON format of the model
* `CNN Model` - A directory that contains CNN model implementation for the same recognition purpose (with 4 gestures)
## Sample of images in the Dataset
* First Hand Gesture
![firstHandGesture.jpg](firstHandGesture.jpg)
* Second Hand Gesture
![secondHandGesture.jpg](secondHandGesture.jpg)
## Required External libraries
* `cv2 (opencv)`
* `imutils`
* `glob`
* `sklearn (scikit-learn)`
* `keras`
* `numpy`
## What You Should See
* For the first gesture
![output1.jpg](output1.jpg)
* For the second gesture
![output2.jpg](output2.jpg)
## Future
I hope to implement more than two gestures in the future. There will be further improvements in the code itself too.
# CNN Implementation
As of May 1, 2019 I have used CNN for the recognition of 4 gestures. All the required files are present in the folder `CNN Model`.
### Sample of Images in the New Dataset
![gesture0.jpg](CNN%20Model/gesture0.jpg)
![gesture1.jpg](CNN%20Model/gesture1.jpg)
![gesture2.jpg](CNN%20Model/gesture2.jpg)
![gesture5.jpg](CNN%20Model/gesture5.jpg)
## Outputs Showing Error %ages
* *CNN* Training Output
![CNNoutput.jpg](CNN%20Model/outputCNN.JPG)
* *Perceptron* Training Output
![PERCEPTRONoutput.jpg](CNN%20Model/outputPERCEPTRON.JPG)
## Improvements and Differences
I've used both the *Perceptron* as well as the *CNN* Model for recognition of 4 hand gestures. And I can easily say *CNN* works better for extracting features of an image. There's and improvement of Error %age from **32%** to **5%**. This happens because Perceptron model is a simple 1 dimensional set of neurons, therefore it reduces a lot of features in the images whereas the *CNN* is specially designed to work with images and works on 2 dimensional set of neurons. You can read more about the algorithms online.
没有合适的资源?快使用搜索试试~ 我知道了~
使用CNN和感知器实时进行手势识别(OpenCV)_Python_下载.zip
共2000个文件
jpg:2298个
py:5个
h5:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 144 浏览量
2023-05-01
01:10:59
上传
评论
收藏 40.55MB ZIP 举报
温馨提示
使用CNN和感知器实时进行手势识别(OpenCV)_Python_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
使用CNN和感知器实时进行手势识别(OpenCV)_Python_下载.zip (2000个子文件)
modelWeights.h5 23.92MB
modelWeights.h5 8.29MB
outputPERCEPTRON.JPG 755KB
outputCNN.JPG 701KB
output2.jpg 32KB
output1.jpg 31KB
secondHandGesture.jpg 15KB
firstHandGesture.jpg 13KB
hand1(325).jpg 8KB
hand1(318).jpg 7KB
hand1(324).jpg 7KB
hand1(317).jpg 7KB
hand1(321).jpg 7KB
hand1(322).jpg 7KB
hand1(830).jpg 7KB
hand1(332).jpg 7KB
hand1(326).jpg 7KB
hand1(320).jpg 7KB
hand1(312).jpg 7KB
hand1(822).jpg 7KB
hand1(960).jpg 7KB
hand1(327).jpg 7KB
hand1(848).jpg 7KB
hand1(323).jpg 7KB
hand1(314).jpg 7KB
hand1(315).jpg 7KB
hand1(330).jpg 7KB
hand1(329).jpg 7KB
hand1(307).jpg 7KB
hand1(331).jpg 7KB
hand1(961).jpg 7KB
hand1(958).jpg 7KB
hand1(319).jpg 7KB
hand1(994).jpg 7KB
hand1(959).jpg 7KB
hand1(957).jpg 7KB
hand1(306).jpg 7KB
hand1(313).jpg 7KB
hand1(829).jpg 7KB
hand1(941).jpg 7KB
hand1(955).jpg 7KB
hand1(954).jpg 7KB
hand1(304).jpg 7KB
hand1(969).jpg 7KB
hand1(832).jpg 7KB
hand1(847).jpg 7KB
hand1(335).jpg 7KB
hand1(989).jpg 7KB
hand1(990).jpg 7KB
hand1(824).jpg 7KB
hand1(841).jpg 7KB
hand1(844).jpg 7KB
hand1(963).jpg 7KB
hand1(968).jpg 7KB
hand1(939).jpg 7KB
hand1(981).jpg 7KB
hand1(998).jpg 7KB
hand1(835).jpg 7KB
hand1(993).jpg 7KB
hand1(977).jpg 7KB
hand1(956).jpg 7KB
hand1(311).jpg 7KB
hand1(985).jpg 7KB
hand1(987).jpg 7KB
hand1(117).jpg 7KB
hand1(823).jpg 7KB
hand1(889).jpg 7KB
hand1(962).jpg 7KB
hand1(819).jpg 7KB
hand1(837).jpg 7KB
hand1(946).jpg 7KB
hand1(125).jpg 7KB
hand1(316).jpg 7KB
hand1(303).jpg 7KB
hand1(845).jpg 7KB
hand1(843).jpg 7KB
hand1(334).jpg 7KB
hand1(995).jpg 7KB
hand1(964).jpg 7KB
hand1(944).jpg 7KB
hand1(114).jpg 7KB
hand1(940).jpg 7KB
hand1(100).jpg 7KB
hand1(834).jpg 7KB
hand1(831).jpg 7KB
hand1(984).jpg 7KB
hand1(992).jpg 7KB
hand1(919).jpg 7KB
hand1(818).jpg 7KB
hand1(817).jpg 7KB
hand1(820).jpg 7KB
hand1(308).jpg 7KB
hand1(828).jpg 7KB
hand1(966).jpg 7KB
hand1(980).jpg 7KB
hand1(846).jpg 7KB
hand1(309).jpg 7KB
hand1(988).jpg 7KB
hand1(839).jpg 7KB
hand1(971).jpg 7KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240528_103010.jpg
- 基于Python的新能源承载力计算及界面设计源码 - HAINING-DG
- 基于Java的本科探索学习项目设计源码 - 本科探索
- 基于Javascript和Python的微商城项目设计源码 - MicroMall
- 基于Java的网上订餐系统设计源码 - online ordering system
- 基于Javascript的超级美眉网络资源管理应用模块设计源码
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功