Skip to content

Commit

Permalink
added a disclaimer, cause people
Browse files Browse the repository at this point in the history
  • Loading branch information
pyskell committed Oct 8, 2015
1 parent b40fe5a commit 9c58738
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ Run `slouchy.py` to have a system tray icon that alerts you when you're slouchin
If it complains about multiple faces run `main.py` and you should get an output image showing everything that looks like a face to the program.

# License
This software is released under the GNU GPL version 3 except for the `haarscascade_frontalface_default.xml` file which is released under the Intel License Agreement For Open Source Computer Vision Library
This software is released under the GNU GPL version 3 except for the `haarscascade_frontalface_default.xml` file which is released under the Intel License Agreement For Open Source Computer Vision Library

# Disclaimer
This software is not intended to diagnosis, cure, or prevent diseases in any way. No warranties are made or implied for its efficacy. It's simply a little program the author wanted and decided to share.
19 changes: 10 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
from configobj import ConfigObj

from main import calculate_c_squared, take_picture, detect_face
from main import video_device, calculate_c_squared, take_picture, detect_face

# Set initial values
def setup():
config = ConfigObj('slouchy.ini')

#video_device can be an int or a string, so try int, and if not assume string
try:
video_device = int(config['MAIN']['video_device'])
except ValueError:
video_device = str(config['MAIN']['video_device'])
# #video_device can be an int or a string, so try int, and if not assume string
# try:
# video_device = int(config['MAIN']['video_device'])
# except ValueError:
# video_device = str(config['MAIN']['video_device'])

maybe_image = take_picture(video_device)
maybe_face = detect_face(maybe_image)
maybe_image = take_picture(video_device)
maybe_face = detect_face(maybe_image)
maybe_c_squared = calculate_c_squared(maybe_face)

if maybe_c_squared.success:
Expand All @@ -25,4 +25,5 @@ def setup():

config.write()

setup()
if __name__ == '__main__':
setup()
5 changes: 3 additions & 2 deletions slouchy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
# How long the tray_icon.py slouching alert should be shown (in secs)

[MAIN]
c_squared_reference = 299377
allowed_variance = 0.035
c_squared_reference = 300730
allowed_variance = 0.0365
cascade_path = /usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml
;cascade_path = haarcascade_frontalface_default.xml
video_device = -1
check_frequency = 30
; alert_duration = 5# Not implemented yet...

0 comments on commit 9c58738

Please sign in to comment.