Skip to content

Lickhill/poseEstimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pose Estimation Project

A real-time pose estimation application that analyzes squats### Activate Virtual Environment

On Windows (cmd):

venv\Scripts\activate

On Windows (PowerShell):

venv\Scripts\Activate.ps1

On macOS/Linux:

source venv/bin/activate

Pose Estimation Project

A 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.

Features

  • Real-time pose detection using MediaPipe
  • Squat form analysis and counting
  • Voice feedback for exercise guidance
  • Visual pose landmarks and angle calculations

Prerequisites

Before running this project, you need to have Python 3.10 installed on your computer.

Step 1: Install Python 3.10

Download Python 3.10

  1. Visit the this Python exe download link: [https://www.python.org/ftp/python/3.10.9/python-3.10.9-amd64.exe]

  2. 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

Install Python on Windows

  1. Run the downloaded installer (.exe file)
  2. Important: Check the box "Add Python 3.10 to PATH" during installation
  3. Choose "Install Now" for default installation
  4. Wait for the installation to complete
  5. Click "Close" when finished

Install Python on macOS

  1. Run the downloaded installer (.pkg file)
  2. Follow the installation wizard
  3. Complete the installation

Install Python on Linux (Ubuntu/Debian)

sudo apt update
sudo apt install python3.10 python3.10-venv python3-pip

Verify Installation

Open your terminal/command prompt and run:

python --version

or

python3 --version

You should see Python 3.10.x displayed.

Step 2: Clone or Download the Project

  1. Download this project to your computer
  2. Extract the files to a folder of your choice
  3. Navigate to the project directory in your terminal/command prompt
cd path\to\poseEstimation

Step 3: Create a Virtual Environment(all in cmd for windows)

A virtual environment helps keep your project dependencies isolated from other Python projects.

Create Virtual Environment

python -m venv venv

or on some systems:

python3 -m venv venv

Activate Virtual Environment

On Windows:

venv\Scripts\activate

On macOS/Linux:

source venv/bin/activate

You should see (venv) at the beginning of your command prompt, indicating the virtual environment is active.

Step 4: Install Dependencies

With your virtual environment activated, install the required packages:

pip install -r requirements.txt

This will install the following packages:

  • mediapipe==0.10.9 - For pose detection
  • opencv-python - For video processing
  • numpy - For numerical computations
  • protobuf==3.20.3 - Required for MediaPipe
  • pyttsx3 - For voice feedback

If you encounter issues with pip:

Try upgrading pip first:

pip install --upgrade pip

Then install the requirements again:

pip install -r requirements.txt

Step 5: Run the Application

Make sure your virtual environment is activated (you should see (venv) in your terminal), then run:

python main.py

Usage

  1. The application will start and access your camera
  2. Position yourself in front of the camera
  3. Perform squats - the system will:
    • Detect your pose in real-time
    • Analyze your squat form
    • Provide voice feedback
    • Count your repetitions
  4. Press q to quit the application

Project Structure

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

Troubleshooting

Camera Issues

  • Make sure your camera is not being used by another application
  • Try disconnecting and reconnecting your camera
  • Check camera permissions in your system settings

Import Errors

  • 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

Performance Issues

  • Ensure good lighting for better pose detection
  • Close other applications to free up system resources
  • Consider lowering the camera resolution if needed

Voice Feedback Not Working

  • 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

Deactivating Virtual Environment

When you're done using the application, you can deactivate the virtual environment:

deactivate

Requirements

  • Python 3.10+
  • Webcam or camera device
  • Microphone (optional, for voice commands)
  • Speakers/headphones (for voice feedback)

Support

If you encounter any issues:

  1. Make sure all installation steps were followed correctly
  2. Check that your camera is working properly
  3. Verify that all dependencies are installed correctly
  4. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages