The program alerts the driver in case he/she falls asleep, and therby reducing the chances of accidents.
- import keras
- import numpy
- import cv2
- import playsound
- import numpy as np
- import imutils
- import time
- import threading
- import argparse
A computer vision system made with the help of Opencv and Keras. OpenCV detects the face,left and right eyes. A snap of left and right eye after processing is fed to the CNN model which predicts whether the eyes are closed or open. If the eyes are closed for a long period of time i.e greater than a given threshold then an alarm sound is played to wake up the driver.
The model is trained on 83201 images and tested on 1697 images. The model is trained for 15 epochs and an accuracy of 99.3% is achieved on the training set and 98% on test set.
An overwiew of the model-
The CNN model and the Dataset can be downloaded from here- https://drive.google.com/drive/folders/1saKOIRmBnm9-PYNOSEuT8Zq66FzOGEIw?usp=sharing