LeverLens: 163 Lines of Pose Estimation for a Niche Fitness Problem
The elbow lever is a calisthenics skill where you hold your body horizontal on your elbows. It is hard to learn without a coach because you cannot see your own form from the ground.
LeverLens replaces the coach with a webcam. It tracks body landmarks through MediaPipe Pose, checks whether your body is horizontal, measures arm angles, estimates height off the ground, and times how long you hold the position. All of it runs in real time.
The Measurements
The horizontality check compares shoulder and hip y-coordinates. If they are within a small threshold, the body counts as level. The arm angle is calculated using vector math from three landmarks: shoulder, elbow, and wrist. The height off the ground is a proxy. It uses the wrist position relative to the frame instead of a real ground measurement.
These three numbers appear on a Pygame display beside the webcam feed. The user sees them update as they adjust their form. It is the closest thing to a spotter that a laptop can provide.
The Display
Most of my earlier pose projects used OpenCV for everything. This one splits the output. OpenCV shows the webcam feed with MediaPipe landmarks drawn on it. Pygame runs a separate window with the metrics in large text. The separation is not necessary for such a small project, but it was useful practice for handling multiple display systems from one loop.
What I Would Change
The assessment is single-plane. It checks sagittal alignment but not lateral twisting. A person could be slightly rotated and the system would still call them horizontal. A torso twist estimate would catch that.
The height measurement uses wrist position as a proxy for body elevation. It is not calibrated. The numbers are relative to the camera framing, not to actual ground distance. A real measurement would need a reference object or a known camera height.
There is no calibration for different body proportions. The horizontality threshold is a fixed value that works for my build but would not generalize. I would make it configurable or derive it from the user landmark distances.
The code is 163 lines and it does one thing. It watches you hold a position and gives you numbers until you drop. That is enough for a skill no other app tracks.