mansikataria / SquatDetection

Detect Squat position using MediaPipe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I have used MediaPipe to detect key points for human body joints, which in turn allows us to detect squat pose.

Here is the Google Colab Notebook

angle logic

Used 4 different angles to detect the squat:

  1. Elbow joint (A), Shoulder joint(B), Hip joint(C) and Knee joint(D).

  2. Apply the three points method to calculate the angle between two lines.

  3. See if the value for the angle between Hip join (C) and Knee joint (D) is less than 130 degrees.

  4. To determine the correct hand position for squat I’ve set the value of the Elbow joint (A) to greater than 130 degrees, and the value of the Shoulder joint(B) to greater than 30 degrees and less than 120 degrees.

  5. The mean square error is used to train the model.

Some sample outputs:

image image

About

Detect Squat position using MediaPipe


Languages

Language:Jupyter Notebook 100.0%