Skip to content

Vessel9817/hand-gesture-recognition

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hand Tracking and Facial Recognition

A real-time hand, face and full-body recognition system built with MediaPipe. Tracks landmarks using a webcam. Can be used for sign language recognition, gesture-based controls or interactive applications, such as VR.

Also included by MediaPipe, but not yet implemented here, is hand gesture categorization.

Table of Contents

Installation Instructions

  1. Clone the repository:

    git clone https://github.com/Vessel9817/hand-gesture-recognition.git
    cd hand-gesture-recognition
  2. Download the landmarking models:

    mkdir models
    curl -o "./models/hand_landmarker.task" https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task
    curl -o "./models/face_landmarker.task" https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task
    curl -o "./models/pose_landmarker.task" https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_heavy/float16/latest/pose_landmarker_heavy.task

    Newer hand, face or full-body models may be available in the future.

  3. Create a virtual environment:

    py -m venv "./venv"
  4. Activate the virtual environment:

    source "./venv/Scripts/activate"
  5. Install the required libraries:

    pip install -r "./requirements-freeze.txt"

Usage

  • Ensure you have a working webcam connected to your device.

  • Run the script:

    1. If not already done in the current shell, activate the virtual environment:

      source "./venv/Scripts/activate"
    2. Run the main Python script:

      py -m src.main
  • Move your hands, face and body around in view of the camera. Play around with it and test its limits!

  • With the window focused, press q to exit the program.

Custom Models

See MediaPipe's custom hand gesture recognition sample for how to create a custom model. The same principles apply to models in general.

Contributing

See: CONTRIBUTING.md

License

This project is licensed under the AGPLv3 License - see the LICENSE file for details.

Credit to the MediaPipe authors for creating the samples this project is in part based on. Individual files contain more specific attributions.

About

A real-time hand gesture recognition system built with Python, OpenCV, and MediaPipe

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages

  • Python 100.0%