6 ms·
Slouchy – a small Python script that warns you if you're slouching
- andheroe 11y agoYou know, I had a similar idea a few years ago. Initial idea was to prevent eye strain. You can check it out: http://viewaide.com/ http://viewaide.com/ Here I analyze more than slouching (distance to the monitor and even blink rate). It was written in C++ in my students years and code style is a shame on me. But if someone is interested, I can upload this on Github.
- sthlm 11y agoI can recommend to peruse the source code. It's well written and documented. Such projects always put a smile on my face, since they demonstrate how far we've come in some respects: - We've learned how to write and produce reusable, easily digestable code - Python gives us a language that is concise, readable - Frameworks like OpenCV let us do incredible things - Open Source allows us to share it and collaborate* - Platforms like Github facilitate the entire experience 10 years ago it took forever to configure my webcam on my Linux machine. I had to scour mailing lists and custom web sites to download various versions of kernel patches. Now my webcam is built-in and it takes 2-3 commands to take something off of Github and have fun. * Of course Open Source is not new, but today it really seems like "Open Source won".
- V-2 11y agoWhat about these magic string: "slouching_alert(QString, QString)"? I don't know Python. Does it work by reflection? I assume these are some kind of bindings to an underlying native API or something? It doesn't look very maintainable...
- zb 11y agoNothing to do with Python, it looks like a Qt thing. Not much the author can do about that.
- mkempe 11y agoQt uses slots and signals to control messaging between threads (e.g. the UI and the workers). The Python binding to Qt is good, but it is auto-generated (from C++) and some of it shows up as non-Pythonic mechanisms or conventions.
- amyjess 11y agoNewer versions of PyQt have replaced the magic strings with a system that's much more Pythonic, using decorators and OOP. I guess the author just wanted to keep backwards compatibility with old versions (or isn't aware of the change). Edit: If anyone's interested, here's the new syntax: http://pyqt.sourceforge.net/Docs/PyQt4/new_style_signals_slots.html http://pyqt.sourceforge.net/Docs/PyQt4/new_style_signals_slo...
- pyskell 11y agoHey there sthim. Slouchy author here. I just wanted to say thank you for your comments. It really put a smile on my face to see someone liked my actual code.
- s3nnyy 11y agoHow do you install that on a mac? Do you have to use http://www.pythonschool.net/pyqt/distributing-your-application-on-mac-os-x/ http://www.pythonschool.net/pyqt/distributing-your-applicati...?
- MasterScrat 11y agoI had a similar idea for public speakers. There are known good and bad stances when you are giving a speech. The idea would be to follow the speaker and recognize his position using for example a kinect camera. You could then get feedback either at the end of a dry run, or in real-time during the presentation.
- reustle 11y agoMaybe feedback through a hidden shock collar of sorts?
- jtheory 11y agoI stop myself from slouching on long drives by adjusting the rearview mirror such that if I'm not sitting up straight, it won't show the back window correctly. I notice pretty quickly when I'm not seeing the full rear window anymore, and adjust my posture. I've been wondering if a similar tactic might work for monitors -- e.g., the same tech that can make a monitor intentionally hard for someone next to you to read might also let you adjust it so that if you slump down a few inches, it's hard to see. Not sure of a similar tactic for public speaking (since nowadays you're likely to have a mic on your lapel...) but it also works for recording; you adjust your posture how it ought to be for good voice production, adjust the mic with it, and then if you slump the mic is no longer in the right place.
- Tepix 11y agoThis is neat. OpenCV can also detect smoking. Will this be the next step in the trend to collect as much health data as possible?
- fennecfoxen 11y agoIf you'd prefer hardware: http://www.lumobodytech.com/lumo-lift/ http://www.lumobodytech.com/lumo-lift/
- bru_ 11y agoGreat, now my credit score will be affected by my posture as well
- agentgt 11y agoI vaguely remember reading that not all slouching is equal and that some forms of slouching are actually better for you (I googled but cannot find the original article but it appears there are various similar articles). For example the leaning backwards slouch is supposedly better for your back than just sitting completely erect.
- mentos 11y agoI've got my monitors on 2 boxes adding about 6 inches each to their height. When I first started looking up to use them it was so uncomfortable and distracting that I could not work. I kept at it though and I find my posture has improved and the thought of going back is now uncomfortable. I also recommend the following exercises which have improved my posture such that people have been saying that I look taller. https://www.youtube.com/watch?v=FTV6UCh-yhs https://www.youtube.com/watch?v=FTV6UCh-yhs I have been doing them against my wall when I have 5 minutes to wait for a build or in the shower when I'm rinsing off.
- brownbat 11y agoReally interesting project! Caveat, not to take anything away from it, but I've found that my posture is mostly correlated with how much exercise I'm getting, and that I have a pretty limited ability to consciously fix it over a sustained period of time. Maybe Slouchy will help you, but if you end up frustrated by constant warnings, consider easing into a routine with some back and shoulders exercises.
- cmclaughlin 11y agoIs the setup menu supposed to do anything? It doesn't do anything for me on a Mac.
- pyskell 11y agoYup, it takes a reference measurement of your upright posture. You should see your webcam indicator light flash. Slouchy then uses this reference to periodically check for slouching. Please note that some Mac cameras require time to "warm up", so if yours is one of these then check slouchy.ini for a camera_delay config option.
- cmclaughlin 11y agoIs the setup menu supposed to do anything? It doesn't do anything for me on a Mac.