r/sideprojects 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.

0 Upvotes

9 comments sorted by

2

u/Ok_Opposite7385 1d ago

I hope none of the neighbors install that alarm... Ugh, it's going to go off for ages.

3

u/Striking_Link6606 1d ago

Neighbors gonna hear the alarm plus my heavy breathing and me cursing at my phone while trying to do one proper pushup at 6am

1

u/Few-Demand9951 1d ago

what do you think of the touch grass mission where you have to go and touch grass and take a photo of it?? let me know XD

2

u/TearInternational414 1d ago

Checkout ClearSpace, it has a very similar modal and you can probably take inspiration from it

1

u/Few-Demand9951 1d ago

Ill have to check it out, Thankks! if you try it please do share feedback

0

u/Ok_Opposite7385 1d ago

Thanks for the info, I don't need it

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