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 evaluation. From the finger class probabilities, the gesture is recognized and using both of the information fingertips are localized. Instead of directly regressing fingertips position from the fully connected (FC) layer of the CNN, we regress the ensemble of fingertips position from a fully convolutional network (FCN) and subsequently take ensemble average to regress the final fingertips positional output.
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. Previous versions visit the release section.
- TensorFlow-GPU==1.15.0
- Keras==2.2.4
- ImgAug==0.2.6
- OpenCV==4.2.0
- Weights:
Download the pre-trained weights
files of the unified gesture recognition and fingertip detection model and put theweights
folder in the working directory.
The weights
folder contains four weights files. The classes5.h5
is for the first five classes, classes8.h5
is for the first eight classes. yolo.h5
and solo.h5
are for the yolo and solo method of hand detection. (what is solo?)
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 the experimentation. The detail 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.
To implement the algorithm, the following network architecture is proposed where a single CNN is utilized for both hand gesture recognition and fingertip detection.
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.
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.
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.