πŸ€– LateAI
Home β€Ί Tutorials β€Ί Personal AI Trainer
πŸ’ͺ

Personal AI Trainer

Intermediate Β· 1 day
πŸ“Ά Intermediate ⏱ 1 day πŸ’° Free (software only) 🏷 CV Zone

πŸ“Œ Overview

Use pose estimation to judge in real time whether a workout movement is correct: with a squat as the example, it computes the changing angles of the hip, knee, and ankle joints, checks whether the range and the tempo are right, and counts reps live.

Built on the Pose Estimation project, it adds joint-angle maths and a movement state machine (down / up / count) - a model example of computer vision solving a real problem.

🧰 What you need

πŸ”§ Step by step

1

Pose detection basics

Use PoseModule to get the 33 body keypoints in real time

Confirm the indices of the hip, knee, and ankle keypoints involved in a squat

2

Compute joint angles

Compute the angle formed by three points (hip-knee-ankle, for example)

Write it as a generic function: three coordinates in, angle out

3

Determine the phase

A large knee angle means standing, a small one means squatting

Define rules such as 0-90 degrees being the down phase

4

Counting logic

State machine: stand, squat, stand counts as one rep

Add hysteresis: stay near the threshold for a short while before switching state

5

Form warnings

Warn when an angle looks wrong (knees caving in, for example)

Show text and a progress bar on the frame

6

Support more exercises

Bicep curls look at the elbow, leg raises at the hip

Parameterise the movement rules so one framework covers many exercises

πŸ’‘ Tips

View original β†— ← Back to LateAI home