Back to the sketchbook

my webcam tells me to sit up

Posture

I slouch at my desk. I already had a webcam and a voice pipeline, so I wired them together.

Status
Shipped
Runs on
My Mac mini M4
Stack
Python, MediaPipe, OpenCV, n8n, ElevenLabs

How it works

  • MediaPipe Pose Landmarker (lite) watches from the side.
  • It picks the side the camera sees best, then measures neck and torso inclination against vertical.
  • It calibrates a personal baseline from the median.
  • It flags slouching on absolute ceilings plus drift from that baseline.
  • It debounces and cools down, so it doesn't nag every second.
  • Events go to n8n, and ElevenLabs speaks.

The sketch

The napkin version. Scroll and it draws itself.

  1. A webcam watches me from the side.
  2. It finds my ear, shoulder and hip, and measures two angles against vertical: neck and torso.
  3. If I stay slouched for a few seconds, the event goes to n8n.
  4. n8n sends it to ElevenLabs, and a voice says: sit up, Garvit.
  5. If I'm sitting fine, it keeps watching.

Decisions

  • Side view, not front view.

    From the front you can only guess the torso angle. From the side you can measure it.

  • Two angles beat five proxies.

    The first version used five proxy metrics. The side view needs just two angles.

  • Debounce everything.

    It nags about slouching, not about reaching for coffee.

What broke

OpenCV's built-in font can't draw the degree sign, so my HUD showed "??". It says "deg" now.

Numbers

  • 25 tests passing
  • 2 angles

Contents

  1. The spark
  2. The sketch
  3. Decisions
  4. Numbers