PosturePal

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 GitHub
Role Developer & Designer
Year 2025
Technologies
Python MediaPipe OpenCV Computer Vision Machine Learning

Demo Video

What it does

Watches your posture

Uses 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.

Gentle reminders

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.

Tracks your habits

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.

How I built it

Pose detection with MediaPipe

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.

Angle math

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 for video processing

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.

Adjustable sensitivity

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.

Notifications that aren't annoying

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.

Session history

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.

Things I had to figure out

Too many false alerts

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.

Bad lighting messes things up

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.

Making it run smoothly

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.