Skip to content

CynapticsAI/AnywherePiano

Repository files navigation

Virtual Piano with OpenCV and Mediapipe

Overview

This project implements a virtual piano using OpenCV and Mediapipe, allowing users to play music by interacting with their hands in front of a camera. The application detects hand keypoints using Mediapipe's Hand module and maps them to corresponding piano keys on the screen.

Demo Video

Virtual Piano Demo

final_demo.mp4

Getting Started

Installation

  • Clone the repository
git clone https://github.com/NAGAMALLYSRUJAN2329/vir_piano.git
cd vir_piano
  • Create new conda environment
conda create -n VirPiano python=3.10
  • Activate the environment
conda activate VirPiano
  • Install dependencies
pip install -r requirements.txt

Local setup

python main.py
  • If you want to change settings of the paino, use the below cli command.
python main.py --model_path "model/hand_landmarker.task" --num_octaves 2 --list_of_octaves "[3,4]" --height_and_width_black "[[5,8],[5,8]]" --shape "(800,600,3)" --tap_threshold 20 --piano_config_threshold 30 --piano_config 1
Controls
  • Quit: Press 'Q' key.

For Streamlit Interface

streamlit run streamlit_main.py

Troubleshooting

  • If there is no hand tracking, try adjusting the camera settings and lighting conditions and try to move the hand slowly in front of the camera.
  • Ensure that your Python environment meets the specified requirements.

Contributers

NAGAMALLYSRUJAN2329
Prachi-0205
Prkhar05
xenom2004

Contributing

Contributions are welcome!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages