I'm the solo developer of FitnessBruh, a workout app for iPhone and Android. You prop the phone against something, step back, and it counts your reps out loud. It is a React Native app, and everything the camera sees is processed on the phone.
Counting sounds like the easy part. It is not. Here is what I learned.
1. A rep is a round trip, not a peak
The obvious way to count is to fire whenever a joint angle crosses a threshold. That also counts half curls and bounces.
In FitnessBruh a rep has to leave a start position, reach the far position and come back. A half curl that never reaches the top is not counted, and the rep is not finished until the arm is straight again. The same rule covers every exercise: pull ups only begin after the app has seen a full hang, and a jumping jack needs arms up and feet apart together, then arms down and feet together. Arms alone do not move the number.
2. The hardest test is standing still
It is easy to count ten clean reps.…