Skip to content

akbarahsan543/Drowsiness-detection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Drowsiness-detection

Application can detect drowsiness and raise alarm.

                                      INSTALLATION INSTRUCTION TO RUN DROWSINESS DETECTION

NOTE: WE WILL CREATE VIRTUAL ENVIRONMENT AND INSTALL ALL DEPENDENCIES IN THAT SO THAT IT WILL NOT CHANGE/AFFECT YOUR ROOT DIRECTORY, JUST BY DELETEING THIS FOLDER YOU CAN DELETE ITS EXISTANCE.

open windows 'cmd' typing cmd in search (not conda command window) as an administrator

  1. Download and install python from> https://www.python.org/downloads/ (if you already have then ignore this step and check its version to be sure)

  2. check python version> python -V

  3. Install virtual environment> pip install virtualenv

  4. test installation> virtualenv --version

  5. Download folder from the drive link and extract it to 'C' drive and rename this folder to 'Drowsiness_detection', if already renamed then please ignore. At this time if you open 'Drowsiness_detection' folder it would contains some files and folder like alarm, detect_drowsiness, shape_predictor_68_face_landmarks.dat (NOTE: You can download 'shape_predictor_68_face_landmarks.dat' file from my drive link https://drive.google.com/file/d/1PH6iDjnrC8ETzIcvySSB7Xa16ce9TOAR/view?usp=sharing)

  6. Now change the directroy to 'Drowsiness_detection' folder (at this type your command prompt window should look like C:\Drowsiness_detection>)

  7. create virtual environment repositery>virtualenv env (this will create a folder with name 'env' inside working reositery 'Drowsiness_detection')

  8. Run the command to activate virtual environment>env\Scripts\activate

(after successful run, cmd window will look like '(env) C:\Drowsiness_detection>' means you have successfully created and activated virtual env and ready to work)

Install necessary packages
  1. (env) C:\Drowsiness_detection>pip install --upgrade imutils
  2. (env) C:\Drowsiness_detection>pip install playsound
  3. (env) C:\Drowsiness_detection>pip install pyobjc
  4. (env) C:\Drowsiness_detection>pip install scipy
  5. (env) C:\Drowsiness_detection>pip install dlib
  6. (env) C:\Drowsiness_detection>pip install opencv-python
  7. (env) C:\Drowsiness_detection>pip install dlib

########## NOW YOU ARE READY To Test SCRIPT ##############################

  1. (env) C:\Drowsiness_detection>python detect_drowsiness.py --shape-predictor shape_predictor_68_face_landmarks.dat

If you want to save alarm audio file run following command

17)(env) C:\Drowsiness_detection>python detect_drowsiness.py --shape-predictor shape_predictor_68_face_landmarks.dat --alarm alarm.wav

For detail please visit link : https://medium.com/@gautamkumarjaiswal/development-of-real-time-drowsiness-detection-system-using-python-a87e3b2f58b6

Reference: [1] https://www.pyimagesearch.com/2017/05/08/drowsiness-detection-opencv/

About

Application can detect drowsiness and raise alarm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%