Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📯 Posture Shamer

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

How it works

  1. On launch, it makes you sit up straight for 3 seconds to calibrate where your face lives when you have good posture.
  2. 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.
  3. Hold a slouch for 1 second: air horn, red flash, giant SLOUCH #7 stamp, counter ticks up.
  4. Keep slouching and it re-blasts you every 4 seconds. It does not get tired. You do.
  5. Quit and it writes a CSV log plus a dark-mode shame chart with every air horn marked on your timeline:

demo chart

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.

Install

Requires Python 3.9+ and a webcam.

git clone https://github.com/Ssstars/posture-shamer.git
cd posture-shamer
pip install -r requirements.txt

Run

python3 posture_shamer.py

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

Tuning

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.

Notes

  • Sound playback uses afplay (macOS). On Linux, swap the play_airhorn function to use aplay airhorn.wav or paplay airhorn.wav. On Windows, winsound.PlaySound works.
  • 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.

License

MIT. Slouch responsibly.

About

Your webcam air-horns you when you slouch. OpenCV, no mercy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages