Drowsiness and Yawn detection to alert drivers.
- Python 3
- opencv
- dlib
- imutils
- scipy
- numpy
- argparse
- pyttsx3
-
Anaconda installation(Ignore if already installed): Click Here
-
Proceed to terminal and create a virtual environment:
conda create -n virenv
-
Activate virtual environment:
conda activate virenv
-
Install dependencies:
pip install -r requirements.txt
-
Install dlib(CPP package):
conda install -c conda-forge dlib
python main.py --webcam 0 //For external webcam, use the webcam number accordingly
Change the threshold values according to distance from camera
EYE_AR_THRESH = 0.3
EYE_AR_CONSEC_FRAMES = 30
YAWN_THRESH = 10` //change this according to the distance from the camera
Rudrajit Choudhuri