Project Setup - supriyak2003/eyecontrol GitHub Wiki
Project Setup: Eye-Controlled Mouse Using OpenCV, MediaPipe, and PyAutoGUI Follow these steps to set up and run the Eye-Controlled Mouse project:
-
Install Python Make sure Python 3.7 or higher is installed on your system. You can download it from Python’s official website. During installation, check the box to add Python to your system PATH.
-
Set Up a Virtual Environment (Optional but Recommended) Open a terminal or command prompt, navigate to your project folder, and create a virtual environment: python -m venv eye_mouse_env Activate the virtual environment: Windows: eye_mouse_env\Scripts\activate macOS/Linux: source eye_mouse_env/bin/activate
-
Install Required Libraries Install the following Python libraries via pip: pip install opencv-python mediapipe pyautogui numpy
-
Download or Create the Project Script Create a Python script (e.g., eye_controlled_mouse.py)
-
Run the Script Save the script and run it from your terminal: python eye_controlled_mouse.py Allow camera access if prompted, and ensure your webcam is enabled.
-
Testing the Setup Cursor Movement: Move your eyes or face to see the cursor follow the direction of your gaze. Click Action: Blink or close your left eye to simulate a click action. The system detects the distance between specific eyelid landmarks to trigger the click.
-
Troubleshooting Ensure proper lighting for accurate facial landmark detection. Adjust webcam angle if detection seems off. If the application lags, verify system performance as high CPU usage may affect processing speed.