Skip to content

Latest commit

Β 

History

60 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‹οΈ PoseInsight: Intelligent Movement Analysis System

PoseInsight is an AI-powered movement analysis platform that evaluates exercise form using computer vision, machine learning, deep learning, and generative AI feedback.

The system bridges the gap between raw pose estimation and actionable coaching by transforming human movement into biomechanical insights, exercise classification, repetition counting, movement-quality prediction, injury-risk detection, and Gemini-powered personalized coaching.

PoseInsight deploys an LSTM-based temporal movement quality predictor that analyzes biomechanical feature sequences across time to classify exercise quality beyond frame-level estimation.

PoseInsight supports:

  • πŸŽ₯ Uploaded Video Analysis
  • πŸ“· Live Webcam Analysis
  • 🧠 ML / DL-based Quality Prediction
  • ⚠️ Injury Risk Detection
  • πŸ’¬ Gemini AI Coaching Feedback

πŸŽ₯ Demo Video

Watch the full live demo here:
PoseInsight Live Demo on YouTube

Watch the demo


πŸš€ Quick Start

1. Clone the repository

git clone <your_repo_url>
cd PoseInsight

Install dependencies

pip install -r requirements.txt

(Optional but recommended) Add Gemini API Key

export GEMINI_API_KEY="your_api_key_here"

Launch the Streamlit app

streamlit run app.py

Project Structure

PoseInsight/
β”œβ”€β”€ app.py                       # Main Streamlit UI
β”œβ”€β”€ build_dataset.py             # Dataset creation pipeline
β”œβ”€β”€ models_training.ipynb        # RF / MLP / LSTM training notebook
β”œβ”€β”€ requirements.txt
β”‚
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ pose_estimator.py        # MediaPipe pose engine
β”‚   β”œβ”€β”€ feature_extractor.py     # Joint angles + biomechanical features
β”‚   β”œβ”€β”€ classifier.py            # Rule-based exercise classification
β”‚   β”œβ”€β”€ rep_segmenter.py         # Repetition counting
β”‚   β”œβ”€β”€ quality_predictor.py     # LSTM-based temporal quality predictor
β”‚   β”œβ”€β”€ risk_detection.py        # Injury risk analysis
β”‚   └── feedback_generator.py    # Gemini coaching + risk summary
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ draw.py                  # Pose skeleton overlay
β”‚   β”œβ”€β”€ io_video.py              # Upload + webcam processing pipeline
β”‚   └── dataset_writer.py        # Dataset export utilities
β”‚
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ lstm_quality.pt          # Primary deployed model
β”‚   β”œβ”€β”€ random_forest_quality.pkl # Baseline benchmark
β”‚   β”œβ”€β”€ mlp_quality.pt           # Experimental benchmark
β”‚   └── model_metadata.json
β”‚
β”œβ”€β”€ data/                        # Good / bad squat + push-up datasets
β”œβ”€β”€ outputs/                     # Processed videos
β”œβ”€β”€ plots_charts/                # Model comparisons + confusion matrices
└── project_docs/                # Architecture + reports

System Pipeline

Video / Webcam Input
        ↓
MediaPipe Pose Estimation
        ↓
Biomechanical Feature Extraction
        ↓
Rule-Based Exercise Classification
        ↓
Rep Counting + Movement Segmentation
        ↓
LSTM-Based Temporal Quality Prediction
        ↓
Risk Detection
        ↓
Gemini AI Coaching Feedback
        ↓
Interactive Streamlit UI

Core Features

🎯 Pose Estimation

  • MediaPipe BlazePose for real-time landmark extraction
  • 33 body landmarks
  • Upload + webcam compatible

πŸ“ Feature Extraction

  • Knee angles
  • Hip angles
  • Elbow angles
  • Trunk angle
  • Symmetry metrics
  • Motion progression

πŸƒ Exercise Classification

Rule-based baseline detects:

  • Squat
  • Push-up
  • Idle / Unknown

πŸ” Repetition Counting

Tracks:

  • Squat reps
  • Push-up reps

🧠 Quality Prediction

Trained and evaluated:

  • Random Forest (baseline)
  • MLP (feedforward benchmark)
  • LSTM (final deployed temporal model)

Predicted classes:

  • Good Squat
  • Bad Squat
  • Good Push-up
  • Bad Push-up

Temporal Modeling Advantage:

Unlike frame-wise models, LSTM analyzes sequential biomechanical progression over time, enabling more context-aware assessment of movement quality and form consistency.

⚠️ Injury Risk Detection

Examples:

  • Forward lean
  • Knee asymmetry
  • Shallow squat
  • Core collapse
  • Shoulder strain

πŸ’¬ Gemini Coaching Feedback

Transforms model outputs into:

  • Personalized coaching
  • Form correction
  • Safety recommendations

Model Training Summary

Models Evaluated:

  • Random Forest
  • MLP
  • LSTM

Current Deployment:

LSTM is the primary deployed model for real-time and uploaded-video quality prediction due to its ability to capture temporal biomechanical movement patterns across frame sequences.

Random Forest and MLP were benchmarked for comparison, but LSTM best aligns with sequence-aware movement analysis objectives.

Saved Assets:

  • Dataset distribution
  • RF / MLP / LSTM comparison
  • Confusion matrices
  • Training curves

πŸ–₯️ User Interface

Upload Mode

βœ” Upload exercise video βœ” Process full session βœ” Pose overlay βœ” Exercise + reps βœ” Quality prediction βœ” Gemini coaching βœ” Injury risk summary

Live Mode

βœ” Real-time webcam βœ” Fixed-duration movement session βœ” Post-session review βœ” Gemini summary

πŸ“ˆ Current Project Status

  • Full end-to-end pipeline
  • Dataset creation
  • RF / MLP / LSTM training
  • Uploaded video analysis
  • Live webcam analysis
  • Quality prediction
  • Risk detection
  • Gemini AI feedback
  • Streamlit deployment
  • Larger dataset expansion (Next step)
  • FastAPI backend (Next step)
  • Docker deployment (Next step)

Responsible AI & Privacy

Privacy

All processing is intended for local execution to reduce exposure of personal video data.

Transparency

PoseInsight is an assistive educational system and should not replace:

  • Medical diagnosis
  • Physical therapy
  • Professional coaching

Fairness & Robustness

Future improvements include:

  • Broader body-type robustness
  • Lighting robustness
  • More exercise classes
  • Larger datasets

Challenges

  • Limited labeled dataset
  • Frame-level pose noise
  • Rule-based baseline limitations
  • Limited labeled sequence data can impact LSTM temporal generalization
  • Webcam variability

Future Work

  • FastAPI backend
  • Docker deployment
  • Expanded dataset
  • Multi-exercise support
  • Expanded labeled dataset for stronger LSTM and Transformer-based temporal learning
  • Mobile deployment
  • Real-time corrective audio coaching

Academic Context

Course: Applied Deep Learning University: University of Florida Instructor: Andrea Ramirez-Salgado

Author

Satyabrata Das M.S. Artificial Intelligence Systems University of Florida satyabradas@ufl.edu

About

Real-time pose-based exercise analysis with deep learning and AI feedback.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages