eyeSafe is a drowsiness detector, mainly designed to support vehicle drivers, especially truck drivers, who mostly have to travel long distances. It uses computer vision techniques to calculate the identify important regions and sounds an alarm if it detects that the eyes are closed for too long. To set up:
You will need to have Python 3 installed along with pip. Run:
pip install opencv-python
pip install scipy
pip install imutils
pip install numpy
pip install playsound
pip install cmake
Another library that has to be installed is dlib. The following link contains the tutorial to install dlib:
https://medium.com/analytics-vidhya/how-to-install-dlib-library-for-python-in-windows-10-57348ba1117f
- Download the alarm.wav file given above.
- Download the
shape_predictor.bat
file from the following Dropbox link: https://www.dropbox.com/s/jbsm8n5wr7e0z3z/shape_predictor.dat?dl=0
Run py cautiousEye.py -p {path to shape_predictor.bat} -a {path to .WAV alarm} -w {index of webcam}
to run the script.
If the alarm sounds even when the eyes are opened, increase the value of the constant EYE_AR_THRESH declared on line 34
If the alarm does not sound even when the eyes are closed, decrease the value of the constant EYE_AR_THRESH declared on line 34
py cautiousEye.py -p Desktop\shape_predictor.bat -a Desktop\alarm.wav -w 0