GestureX is a Python application that recognizes hand gestures using a webcam and maps them to custom commands making the interaction with your computer more intuitive, fun and inclusive. The application provides a real-time preview of the webcam feed with hand gesture recognition. It is easily configurable through a graphical user interface and supports multiple camera sources.
- Hand gesture recognition: The application recognizes hand gestures using a webcam;
- Real time preview: The application provides a real-time preview of the webcam feed with hand gesture recognition;
- Multiple camera sources: The application supports multiple camera sources;
- Easily configurable: The application is easily configurable through a graphical user interface.
-
Clone the repository (Pick your favorite mirror):
git clone https://git.0x7f.in/sarthak/GestureX
git clone https://github.com/flying-pizza-69/GestureX.git
-
Create and activate Virtual Environment
cd GestureX python3 -m venv venv source venv/bin/activate
-
Install the required dependencies:
(venv) pip install -r requirements.txt
-
Install the required fonts to display emojis
- Arch Linux
pacman -S noto-fonts-emoji
- Ubuntu or Debian
apt-get install fonts-noto-color-emoji
- Fedora or RHEL Based
dnf install google-noto-emoji-fonts
- openSUSE
zypper install google-noto-emoji-fonts
-
Run the application:
python3 gui.py
- Start the application by running the
gui.py
script; - Set the camera source and the desired hand gesture commands in the graphical user interface;
- Perform the hand gestures in front of the webcam to trigger the mapped commands and interact with your computer;
- (Optional) Import the
gestures_commands.json
file to get sample bindings to test the app.
Hand Gesture Name | Gesture |
---|---|
Okay | 👌 |
Peace | ✌️ |
Thumbs Up | 👍 |
Thumbs Down | 👎 |
Call Me | 🤙 |
Stop | ✋ |
Rock and Roll | 🤘 |
Fist Bump | 👊 |
Smile Hand | 👉 |
Live Long | 🖖 |
These are the default gestures recognized by the model I am currently using. I am also working on the possibility of adding your custom gestures and on the support for dynamic gestures. If you have any suggestions or want to contribute to the project, feel free to open an issue or submit a pull request.
This project utilizes the following libraries:
- OpenCV for the webcam feed and image processing;
- Google MediaPipe project for the hand gesture recognition model;
- Gtk for the graphical user interface;
This project is licensed under the MIT License - see the LICENSE file for details.
If pip won't install PyGObject because pycairo is missing, you should check if you have the libgtk-4-dev
package installed.
If python complains about missing cv2
, you'll need the python3-opencv
package. Afterwards rebuild the venv.