Skip to content

Code-Sey/SquatCoachAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

SquatCoach AI

This is an ai squat analyzer!!

SquatCoach AI is a computer-vision tool that analyzes squat form in real time using OpenCV + MediaPipe Pose in Python. It detects depth, counts reps, identifies bad reps, and flags knee valgus(when the knees cave and collapse in) using only a webcam.

This is the Fall 2025 Ignition Challenge submission for my AI-powered fitness project.

Why I Built this?

Many beginners in the gym do not know proper form. As they add weight without proper form, their risk of injury skyrockets, mainly due to knee valgus

Hiring a trainer is expensive

Thats where Squatcoach AI comes in It analyzes your form live and tells you what your body is doing automatically

Key Features

  1. Side Mode has Rep Counting + Depth Tracking

Tracks hip–knee–ankle angles in real time

Recognizes squat stages (s1 → s2 → s3 → s1) Side Mode demo

Counts good reps

Detects bad reps (with shallow depth or incorrect sequence)

  1. Front Mode has Knee Valgus Detection

Detects inward knee collapse using hip width + knee position

Shows red knee indicators when valgus occurs at the bottom of the squat

Helps prevent injuries for beginners

  1. Automatic Mode Switching

Uses shoulder width to detect whether user is facing the camera

Switches between Side Mode and Front Mode instantly

No buttons, no manual input

  1. Real-Time On-Screen Feedback

Angle text

Rep counter

Bad rep counter

Valgus status

Visual indicators (green means safe, red means warning)

Tech Stack used Python: Holds all the core logic OpenCV: allows us to utilize Webcam and on screen drawing Mediapipe Pose: Landmark detections Numpy: angle math as well as calulations

How it Works

  1. Mediapipe tracks 33 pose landmarks

  2. The program selects the knee closest to the camera

  3. Calculates angle between hip–knee–ankle of the closest knee

  4. Classifies squat into 3 states:

s1 = standing

s2 = Descending and Acending

s3 = depth( bottom)

FSM Diagram 5. When user returns to s1, system determines:

Good rep if the movement passed s3 properly

Bad rep if shallow or incorrect sequence

  1. In front mode, knee x-position is compared to hip midline

7.If knee crosses inward beyond a threshold, then valgus is detected Valgus Demo

Target Audience

Beginners learning to squat,

Athletes practicing technique,

People without access to a coach,

Gym-goers wanting instant feedback,

or Developers interested in AI movement analysis,

In the future, I will add more excercises, use on screen and voice feedback, and train my very own model as well as making an app

Demo Video https://youtu.be/SsT3RmO5uZ4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages