Skip to content

Different (Boxing, basketball, football, athletics) estimation of pose using OpenCV and Mediapipe

Notifications You must be signed in to change notification settings

darshanp2005/DS-Estimation

Repository files navigation

DS (DifferentSports)-Estimation

This project demonstrates pose estimation on athlete videos using OpenCV and MediaPipe in Python. It tracks joint angles and generates annotated videos as well as plots for movement analysis.

Features

  • Detects human poses in videos using MediaPipe.
  • Tracks joint angles (e.g., left elbow, right knee).
  • Annotates and saves processed videos (*_pose.mp4).
  • Plots joint angles over time for detailed analysis.
  • Supports multiple athlete categories: Basketball, Boxing, Football, Athletics, etc.
  1. Create and activate a Python virtual environment (Python 3.11 is recommended):

    conda create -n pose_env python=3.11
    conda activate pose_env
  2. Install the required packages:

    pip install opencv-python mediapipe matplotlib numpy

How to Run

  1. Place your athlete videos inside the Videos/ folder.
  2. Open final.ipynb in VSCode or Jupyter Notebook.
  3. Run the notebook cells in the following order:
    • Imports & functions
    • Define categories
    • Analyze videos
    • Plot joint angles
  4. Annotated videos will be saved automatically in the same folder with the *_pose.mp4 suffix.

Demo / Output Examples

Here is an example of the output you can expect from the project.

Annotated Video Output

Basketball Pose Estimation Boxing Pose Estimation
Annotated Basketball Pose Estimation Annotated Boxing Pose Estimation

Joint Angle Plots

Basketball Joint Angles Football Joint Angles
Plot of basketball joint angles Plot of football joint angles

Application in Sports

  1. Helps player to analyse their shooting posture
  2. Helps coaches to replan the training sessions for players
  3. For identifying skills
  4. Injury prevention, Rehabilitation Support

About

Different (Boxing, basketball, football, athletics) estimation of pose using OpenCV and Mediapipe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published