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.
- 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.
- Python 3.7+
- OpenCV
- MediaPipe
- Streamlit
- Streamlit WebRTC
- NumPy
-
Clone the repository:
git clone https://github.com/yourusername/raise-hand-detection.git cd raise-hand-detector
-
Install the required dependencies:
pip install -r requirements.txt
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.
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.
- 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.
-
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 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
):
Feel free to open issues or submit pull requests to improve the functionality or extend the project.
This project is open-source and available under the MIT License.
- 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.