A posture monitoring app that watches your webcam and gives you a little nudge when you start slouching. Built with Python, MediaPipe, and OpenCV.
View on GitHubUses your webcam to track your body position in real time. It picks up on things like slouching, leaning forward, or hunching your shoulders while you work.
When it notices you've been in a bad position for a while, it gives you a heads up. Nothing aggressive, just a little visual cue so you can fix it before your back starts hurting.
Keeps a log of how you've been sitting throughout the day so you can see patterns. Turns out I slouch way more after lunch.
MediaPipe tracks 33 points on your body from the webcam feed. I use those landmarks to figure out where your head, shoulders, and spine are relative to each other.
The app calculates angles between your joints to determine if you're slouching. For example, if the angle between your ear, shoulder, and hip drops below a threshold, that's a slouch.
OpenCV handles the webcam feed, frame processing, and drawing the skeleton overlay. I optimized the pipeline to keep things smooth without eating up your CPU.
Everyone sits differently, so you can tweak how sensitive the detection is. Some people naturally lean forward and that's fine, the app adapts to you.
You get a visual overlay on screen and an optional desktop notification. I specifically made sure it doesn't interrupt you every five seconds. It waits until you've actually been slouching for a bit.
Your posture data gets saved between sessions so you can look back and see if you're actually improving over time. Spoiler: it's motivating when you do.
At first it would yell at you every time you reached for your coffee. I added a time-based check so it only flags you if you've been in a bad position for several seconds in a row, not just a quick lean.
The pose detection got really flaky in dim rooms or when there was a bright window behind you. I added some preprocessing filters and confidence thresholds to handle these situations better.
The early version was pretty laggy on my laptop. I fixed it by skipping some frames, reducing the model complexity, and caching results. Now it runs at a solid 30 FPS without turning your computer into a space heater.