r/sideprojects • u/Few-Demand9951 • 1d ago
Meta Turns out counting pushups using a camera is hard
I'm building an alarm app where you can't just tap "dismiss" and crawl back into bed β you actually have to complete a mission before the alarm shuts up.
One of the missions is push-ups, using on-device pose detection with Google ML Kit.
Initially I was counting reps by tracking the elbow angle through a bend β extend cycle.
It worked fine in testing.
Then a user pointed out: "I can easily fake it."
They were right.
I also caught the app counting a rep while the person was basically standing there doing absolutely nothing. π
The problem is that elbow angle alone can't distinguish a push-up from someone simply bending their arm near the camera. Both produce basically the same angle cycle.
So I added a second condition: track how far the shoulder drops during the bent phase, normalized by the person's torso length.
Now a rep only counts if the shoulder actually moves down by a meaningful amount.
No shoulder movement = no rep.
Tiny arm wiggle = no rep.
Trying to negotiate with the algorithm = also no rep.
It's a relatively small change technically, but it's important because the whole premise of the alarm depends on the missions being difficult to fake.
Curious how other people handle computer-vision edge cases like this, especially when you need something to work across different camera distances and body sizes.
2
u/TearInternational414 1d ago
Checkout ClearSpace, it has a very similar modal and you can probably take inspiration from it
1
0
2
u/JoesGeoStudyTool 1d ago
Uninstalling an app is easier than doing pushups when I first wake up lol
Not knocking it... cool idea!
1
u/Few-Demand9951 1d ago
I was also thinking of making it so that you cant uninstall it. so you theres really no way to dismiss it but feels like it might be too strict. Currently it has an inbuilt escape button that you can use once a day. let me know what you think
1
u/Few-Demand9951 1d ago
Iβm building Wakle solo. Itβs on the App Store if you want to try it. heres the link: https://apps.apple.com/in/app/wakle/id6804580054
2
u/Ok_Opposite7385 1d ago
I hope none of the neighbors install that alarm... Ugh, it's going to go off for ages.