A real-time pose estimation application that analyzes squats### Activate Virtual Environment
On Windows (cmd):
venv\Scripts\activateOn Windows (PowerShell):
venv\Scripts\Activate.ps1On macOS/Linux:
source venv/bin/activateA real-time pose estimation application that analyzes squats using computer vision and provides voice feedback. This project uses MediaPipe for pose detection and OpenCV for video processing.
- Real-time pose detection using MediaPipe
- Squat form analysis and counting
- Voice feedback for exercise guidance
- Visual pose landmarks and angle calculations
Before running this project, you need to have Python 3.10 installed on your computer.
-
Visit the this Python exe download link: [https://www.python.org/ftp/python/3.10.9/python-3.10.9-amd64.exe]
-
Download the appropriate installer for your operating system:
- Windows: Download "Windows installer (64-bit)" or "Windows installer (32-bit)" depending on your system
- macOS: Download "macOS 64-bit universal2 installer"
- Linux: Use your distribution's package manager or download the source code
- Run the downloaded installer (
.exefile) - Important: Check the box "Add Python 3.10 to PATH" during installation
- Choose "Install Now" for default installation
- Wait for the installation to complete
- Click "Close" when finished
- Run the downloaded installer (
.pkgfile) - Follow the installation wizard
- Complete the installation
sudo apt update
sudo apt install python3.10 python3.10-venv python3-pipOpen your terminal/command prompt and run:
python --versionor
python3 --versionYou should see Python 3.10.x displayed.
- Download this project to your computer
- Extract the files to a folder of your choice
- Navigate to the project directory in your terminal/command prompt
cd path\to\poseEstimationA virtual environment helps keep your project dependencies isolated from other Python projects.
python -m venv venvor on some systems:
python3 -m venv venvOn Windows:
venv\Scripts\activateOn macOS/Linux:
source venv/bin/activateYou should see (venv) at the beginning of your command prompt, indicating the virtual environment is active.
With your virtual environment activated, install the required packages:
pip install -r requirements.txtThis will install the following packages:
mediapipe==0.10.9- For pose detectionopencv-python- For video processingnumpy- For numerical computationsprotobuf==3.20.3- Required for MediaPipepyttsx3- For voice feedback
Try upgrading pip first:
pip install --upgrade pipThen install the requirements again:
pip install -r requirements.txtMake sure your virtual environment is activated (you should see (venv) in your terminal), then run:
python main.py- The application will start and access your camera
- Position yourself in front of the camera
- Perform squats - the system will:
- Detect your pose in real-time
- Analyze your squat form
- Provide voice feedback
- Count your repetitions
- Press
qto quit the application
poseEstimation/
├── main.py # Main application file
├── pose_utils.py # Pose calculation utilities
├── squat_rules.py # Squat analysis logic
├── voice_feedback.py # Voice feedback system
├── requirements.txt # Python dependencies
├── test.py # Test file
└── README.md # This file
- Make sure your camera is not being used by another application
- Try disconnecting and reconnecting your camera
- Check camera permissions in your system settings
- Make sure your virtual environment is activated
- Reinstall the requirements:
pip install -r requirements.txt - Check that Python 3.10 is being used:
python --version
- Ensure good lighting for better pose detection
- Close other applications to free up system resources
- Consider lowering the camera resolution if needed
- Check your system's audio output settings
- Make sure your speakers/headphones are connected
- On some systems, you might need to install additional audio libraries
When you're done using the application, you can deactivate the virtual environment:
deactivate- Python 3.10+
- Webcam or camera device
- Microphone (optional, for voice commands)
- Speakers/headphones (for voice feedback)
If you encounter any issues:
- Make sure all installation steps were followed correctly
- Check that your camera is working properly
- Verify that all dependencies are installed correctly
- Ensure you're using Python 3.10
Note: This project requires a camera to function properly. Make sure your camera is connected and permissions are granted before running the application.