GithubHelp home page GithubHelp logo

mahmudulalam / unified-gesture-and-fingertip-detection Goto Github PK

View Code? Open in Web Editor NEW
294.0 7.0 53.0 74.7 MB

Unified learning approach for egocentric hand gesture recognition and fingertip detection.

Home Page: https://www.sciencedirect.com/science/article/pii/S0031320321003824

License: MIT License

Python 100.00%
gesture-recognition fingertip-detection hand-detection unified-detection yolo solo cnn convolutional-network hand-gesture-recognition regression

unified-gesture-and-fingertip-detection's Introduction

Unified Gesture Recognition and Fingertip Detection πŸ‘‹

GitHub stars GitHub forks GitHub issues Version GitHub license

A unified convolutional neural network (CNN) algorithm for both hand gesture recognition and fingertip detection at the same time. The proposed algorithm uses a single network to predict both finger class probabilities for classification and fingertips positional output for regression in one single evaluation. From the finger class probabilities, the gesture is recognized, and using both of the information fingertips are localized. Instead of directly regressing the fingertips position from the fully connected (FC) layer of the CNN, we regress an ensemble of fingertips position from a fully convolutional network (FCN) and subsequently take ensemble average to regress the final fingertips positional output.

Update πŸ”₯

Included robust real-time hand detection using yolo for better smooth performance in the first stage of the detection system and most of the code has been cleaned and restructured for ease of use. To get the previous versions, please visit the release section.

Requirements 🐍

  • TensorFlow-GPU==2.2.0 pip install tensorflow-gpu==2.2.0
  • OpenCV==4.2.0 pip install opencv-python==4.2.0
  • ImgAug==0.2.6 pip install imgaug==0.2.6
  • Weights: Download the pre-trained weights files of the unified gesture recognition and fingertip detection model and put the weights/ folder in the working directory.

Downloads Downloads

The weights/ folder contains three weights files. The fingertip.h5 is for unified gesture recognition and fingertip detection. yolo.h5 and solo.h5 are for the yolo and solo method of hand detection. (what is solo?)

Paper πŸ“š

Paper Paper

To get more information about the proposed method and experiments, please go through the Elsevier or ArXiv version of the paper. Cite the paper as:

@article{alam2022unified,
  title={Unified learning approach for egocentric hand gesture recognition and fingertip detection},
  author={Alam, Mohammad Mahmudul and Islam, Mohammad Tariqul and Rahman, SM Mahbubur},
  journal={Pattern Recognition},
  volume={121},
  pages={108200},
  year={2022},
  publisher={Elsevier}
}

Dataset πŸ—‚οΈ

Dataset

The proposed gesture recognition and fingertip detection model is trained by employing Scut-Ego-Gesture Dataset which has a total of eleven different single hand gesture datasets. Among the eleven different gesture datasets, eight of them are considered for experimentation. A detailed explanation about the partition of the dataset along with the list of the images used in the training, validation, and the test set is provided in the dataset/ folder. You can download πŸ’Ύ:file_folder: the pre-processed dataset that was used for experimentation. The shared folder also contains two python scripts to load the dataset.

Network Architecture πŸ•ΈοΈ

To implement the algorithm, the following network architecture is proposed where a single CNN is utilized for both hand gesture recognition and fingertip detection.

Prediction πŸ‘½

To get the prediction on a single image run the predict.py file. It will run the prediction in the sample image stored in the data/ folder. Here is the output for the sample.jpg image.

Real-Time! πŸ“Έ

To run in real-time simply clone the repository and download the weights file and then run the real-time.py file.

directory > python real-time.py

In real-time execution, there are two stages. In the first stage, the hand can be detected by using either you only look once (yolo) or single object localization (solo) algorithm. By default, yolo will be used here. The detected hand portion is then cropped and fed to the second stage for gesture recognition and fingertip detection.

Output 🎨

Here is the output of the unified gesture recognition and fingertip detection model for all of the 8 classes of the dataset where not only each fingertip is detected but also each finger is classified.

Contact Me! πŸ›πŸ“’πŸŒŽπŸš©πŸš§:mailbox_with_mail:

If you have any queries or concerns, please feel free to contact me.

unified-gesture-and-fingertip-detection's People

Contributors

mahmudulalam 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

unified-gesture-and-fingertip-detection's Issues

Custom Model keyword arguments Error

Change
model = Model(input=model.input, outputs=[probability, position])
to
model = Model(inputs=model.input, outputs=[probability, position])
on line 22 of net/network.py

Using old versions of tensorflow, can't install the dependencies on my macbook and with newer versions it's constatly failing.

When trying to install the required version of tensorflow:

pip3 install tensorflow==1.15.0
ERROR: Could not find a version that satisfies the requirement tensorflow==1.15.0 (from versions: 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.2.2, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.3.2, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.4.0, 2.4.1)
ERROR: No matching distribution found for tensorflow==1.15.0

I even tried downloading the .whl file from the pypi and try manually installing it, but that didn't work too:

pip3 install ~/Downloads/tensorflow-1.15.0-cp37-cp37m-macosx_10_11_x86_64.whl
ERROR: tensorflow-1.15.0-cp37-cp37m-macosx_10_11_x86_64.whl is not a supported wheel on this platform.

Tried with both python3.6 and python3.8

So it would be great to update the dependencies :)

About datasets

how to get the files like train_y_keys.npy and train_y_prob.npy?I may be careless and i cant find these in code.
thank you for answering

how to download the weights, code not contain?

The weights folder contains three weights files. The comparison.h5 is for first five classes and performance.h5 is for first eight classes. solo.h5 is for hand detection. but no link

Problem of weights

Hi,when load the solo.h5(In solo.py line 14:"self.model.load_weights(weights)") it will report errors:
Process finished with exit code -1073741819 (0xC0000005)
keras2.2.5+tensorflow1.14.0+cuda10.0

Datasets

Hello,
I have a question about the dataset from your readme, I can't download the Scut-Ego-Gesture Dataset ,Because in China, this website has been banned. Can you share it with me in other ways? For example, Google or QQ email: [email protected]

why are there two hand detection provided?

A wonderful work!!As mentioned above, the Yolo and Solo detection models are provided. I wonder what is the advatange of each model comparing to the other and what is the dataset to train the detect.

Difference of classes5.h5 and classes8.h5

Hi, May i know the difference when training classes5 and classes8? are the difference from the dataset used for training by excluding SingleSix, SingleSeven, SingleEight or there are other modification such as changing the model structure or parameters?

Thanks

tensorflow-gpu package is no longer supported

Proposed Solution

  1. Update the project's dependencies by replacing "tensorflow-gpu" with "tensorflow" in the project's requirements or setup files.
  2. Test the project to ensure it functions correctly with the new package.
  3. Update the project's documentation to reflect this change.

OSError: Unable to open file (unable to open file: name = 'weights/performance.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 88, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = 'weights/performance.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

left hand?

Hi, first it's really cool work!

Is the left hand included in the training images? I have been playing around with some of my own images and it seems that it doesn't really recognize the left hand in a palm-down position...

If I want to include the left hand, do you think it would be possible if I train the network with the image flipped?

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.