Skip to content

A real-time hand raise detection application using MediaPipe, OpenCV, and Streamlit. It detects when a user raises their hand in front of a webcam and provides visual feedback. Ideal for interactive educational sessions, meetings, and gesture recognition experiments.

License

Notifications You must be signed in to change notification settings

emanmunir/Raised-Hand-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raise Hand Detector

This is a simple application that uses the webcam to detect if you raise your hand, built with OpenCV, MediaPipe, and Streamlit. It displays a message whenever hand is raised.

Features

  • Detects if your hand is raised in front of the webcam.
  • Uses MediaPipe for hand landmark detection.
  • Streamlit for a simple web interface.
  • Real-time video streaming with Streamlit WebRTC.

Requirements

  • Python 3.7+
  • OpenCV
  • MediaPipe
  • Streamlit
  • Streamlit WebRTC
  • NumPy

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/raise-hand-detection.git
    cd raise-hand-detector
  2. Install the required dependencies:

    pip install -r requirements.txt

Usage

To run the hand raise detector, execute:

streamlit run main.py

This will start a Streamlit server, and you can access the application in your web browser.

File Structure

  • main.py: The main script that runs the hand raise detector.
  • requirements.txt: Lists all dependencies required to run the project.
  • README.md: Project documentation.

How It Works

  • The script uses MediaPipe to track hand landmarks.
  • It checks if all fingers are straight up (by comparing the Y-coordinates of each fingertip with the preceding joint).
  • If all fingers are raised, it displays a message "I raised my hand!" on the video feed.

Images Displayed

  • Hand Raised: When the application detects a raised hand, it displays a message saying "I raised my hand!" on the video feed. The image shown below (images/raised.png) provides a visual representation of what it looks like when a hand is successfully detected as raised:

    Hand Raised

  • Hand Not Raised: If no hand is raised, or the conditions for detecting a raised hand are not met, the application will not display the message. The default state of the application is depicted in the image below (images/not.png):

    Hand Not Raised

Contributing

Feel free to open issues or submit pull requests to improve the functionality or extend the project.

License

This project is open-source and available under the MIT License.

Acknowledgments

  • MediaPipe for the hand detection model.
  • Streamlit for making web applications easy to build.

Explanation:

  • Project Overview: Provides a simple description of what the project does.
  • Features: Describes the main capabilities.
  • Requirements and Installation: Guides users through installing necessary packages and running the app.
  • Usage Instructions: Shows how to start the application.
  • How It Works: Explains the logic of hand detection.
  • Contribution and License: Information for those who want to contribute or know the legal permissions.

About

A real-time hand raise detection application using MediaPipe, OpenCV, and Streamlit. It detects when a user raises their hand in front of a webcam and provides visual feedback. Ideal for interactive educational sessions, meetings, and gesture recognition experiments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages