11AI Gym Trainer

11 · Personal project · April 2025 · 2 min read

A trainer that counts your curls from the angle of your elbow

  • Python
  • Flask
  • OpenCV
  • MediaPipe
  • Chart.js
Role
Solo, end to end
The dashboard, the Flask backend and the tracking
Stage
Exploration, personal
A working prototype on my own webcam
Counts
Bicep curls
From the elbow's angle, with MediaPipe
Stack
Flask + MediaPipe
OpenCV for the camera, Chart.js for the charts

The idea

FitPro is a fitness dashboard with a trainer built in: your webcam watches your arm and counts your bicep curls as you do them. I designed and built it on my own in April 2025, with Flask streaming the tracked camera feed straight into the page.

Six curls, counted live: the stage flips from down to up with each one.

How it works

MediaPipe finds the shoulder, the elbow and the wrist in each frame. The app takes the angle at the elbow, between the line up to the shoulder and the line out to the wrist, and reads it against two thresholds instead of one.

  1. DownOver 160°, the angle is obtuse and the arm is straight, so the stage resets to down
  2. UpUnder 30°, the angle is acute and the arm is curled; if the stage was down, it turns up and counts one rep
  3. Why twoA curl only counts after the arm has straightened again, so a half rep, or a wobble around one threshold, never counts twice

Two full curls: the arm straightens past 160° (down), then curls under 30° (up), and each one counts.

The angle at the elbow, a full rep and a half one.

Around it

Around the camera is a dashboard: a workout calendar, and charts for calories, training and sleep. The charts are still on sample data; the counting is the part that's real.

The dashboard, with the tracked camera feed counting reps.

What's real

It counts one exercise, bicep curls, on one arm. The angle comes from each point's position in the picture, not in depth, so it's the angle the camera sees rather than the arm's true one.