Gesture Mouse Using Python is a computer vision application that controls mouse operations through webcam-based hand gestures. Built with Python, OpenCV, MediaPipe, PyAutoGUI, Flask and Scikit-learn, it supports cursor movement, clicking, dragging, scrolling, zoom controls, custom gesture training and a standalone desktop application.
Gesture Mouse Using Python is a computer vision application that allows users to control their computer mouse through hand gestures detected by a webcam. It combines real-time hand tracking, gesture recognition, machine learning and mouse automation to provide an alternative way to interact with a computer.
The application includes a Flask-based web interface and a standalone desktop application. Users can move the cursor, perform mouse clicks, drag and drop items, scroll pages, zoom in and out, and train custom gesture recognition models.
The project is developed using Python, OpenCV, MediaPipe, PyAutoGUI, Flask and Scikit-learn. It uses local CSV, JSON and Joblib files for gesture samples, settings and trained model storage rather than requiring a traditional database.
Uses MediaPipe to detect hand landmarks from webcam frames. The detected finger positions are processed to identify supported gestures and translate them into mouse operations.
Moves the mouse cursor according to hand movements detected by the webcam. Cursor speed controls are available to adjust movement behavior.
Supports dragging items by holding the mouse button while making the configured fist gesture.
Allows users to scroll pages upward and downward and trigger zoom-in or zoom-out actions using predefined hand gestures.
Displays the webcam feed and detected hand landmarks. Users can select an available camera and manage mouse control from the web interface.
The training module collects hand landmark samples and trains a gesture classifier using Scikit-learn. Joblib saves the trained model for later use.
Supports associating trained gestures with configured keyboard shortcuts, allowing users to extend the available gesture controls.
Provides illustrated instructions describing supported gestures and how to perform them correctly.
The desktop version enables webcam-based mouse control outside the browser using the application's Python interface.
Extract the project ZIP file and open the Gesture folder in Visual Studio Code. Create a Python 3.11 virtual environment, activate it and install the dependencies from requirements.txt.
py -3.11 -m venv venv
venv\Scripts\activate
python -m pip install --upgrade pip
pip install -r requirements.txt
To launch the web application, run:
python web.py
To launch the standalone desktop application, run:
python app.py
Open the local URL displayed in the terminal when running the web application. Make sure the webcam is connected and available. Press Esc in the camera window to exit the desktop application.
The application can control actual mouse and keyboard actions on the computer. Use it carefully, test gestures before regular use and disable mouse control whenever it is not required.
1. Install Python 3.11 and Visual Studio Code. 2. Extract the project ZIP file and open the Gesture folder in VS Code. 3. Confirm that app.py, web.py and requirements.txt are present. 4. Open the integrated terminal. 5. Create a virtual environment using: py -3.11 -m venv venv 6. Activate the environment using: venv\Scripts\activate 7. Upgrade pip using: python -m pip install --upgrade pip 8. Install the project dependencies using: pip install -r requirements.txt 9. Ensure the webcam is connected and available. 10. Run the web application using: python web.py 11. Open the local URL displayed in the terminal. 12. Navigate to the Camera page and select your webcam. 13. Enable mouse control and test the supported gestures. 14. Open the Training page to collect samples and train a custom gesture classifier. 15. To run the standalone desktop version, stop the web application and execute: python app.py 16. Press Esc in the desktop camera window to exit. 17. If dependency installation fails, verify that the active Python interpreter is Python 3.11 and check the project's requirements.txt.
FAQ for this project coming soon.
No reviews yet. Be the first to review!