Your webcam watches you work. When you slouch, it air-horns you, flashes the screen red, and increments a public counter of your failures. When you quit, it generates a chart of your spine giving up over the course of the day.
Built with OpenCV, numpy, and a complete lack of mercy.
posture_shamer_demo.mp4
- On launch, it makes you sit up straight for 3 seconds to calibrate where your face lives when you have good posture.
- It then tracks your face continuously. Slouching moves your face down and closer to the camera. Both are measured in units of your own face height, so it works at any distance from the screen.
- Hold a slouch for 1 second: air horn, red flash, giant
SLOUCH #7stamp, counter ticks up. - Keep slouching and it re-blasts you every 4 seconds. It does not get tired. You do.
- Quit and it writes a CSV log plus a dark-mode shame chart with every air horn marked on your timeline:
The air horn is synthesized from scratch with numpy (sawtooth cluster, pitch scoop, soft clipping), so there are no audio samples to download and no copyright strikes when you post your suffering online.
Requires Python 3.9+ and a webcam.
git clone https://github.com/Ssstars/posture-shamer.git
cd posture-shamer
pip install -r requirements.txtpython3 posture_shamer.pyThe air horn WAV is generated automatically on first run.
On macOS, your terminal will ask for camera permission the first time. Grant it (System Settings → Privacy & Security → Camera) and run again.
| Key | Action |
|---|---|
SPACE |
Recalibrate (sit up straight first, obviously) |
m |
Mute the horn (coward mode) |
q |
Quit and generate the shame chart |
Sessions are saved to sessions/ as a CSV log and a PNG chart.
All the knobs are at the top of posture_shamer.py:
| Constant | Default | Meaning |
|---|---|---|
SLOUCH_THRESHOLD |
55 |
Score (0-100) that counts as slouching. Lower = crueler. |
SUSTAIN_SECONDS |
1.0 |
How long you must slouch before the horn fires. |
REBLAST_SECONDS |
4.0 |
Horn cooldown while you remain slouched. |
DROP_FULL |
0.85 |
Face-heights of vertical drop that maxes the drop score. |
LEAN_FULL |
0.45 |
Fractional face growth (leaning in) that maxes the lean score. |
- Sound playback uses
afplay(macOS). On Linux, swap theplay_airhornfunction to useaplay airhorn.wavorpaplay airhorn.wav. On Windows,winsound.PlaySoundworks. - Face detection is OpenCV's stock Haar cascade: no model downloads, runs fast on anything. It occasionally loses you if you turn fully sideways, which is fair, because you should be facing your work.
- Everything runs locally. No frames leave your machine. The only thing being uploaded is your self-esteem.
MIT. Slouch responsibly.
