This is a Python application that uses neural networks and computer vision to detect whether a driver is drowsy or not. The application utilizes non-intrusive methods to accurately determine driver state in real-time and generate effective and acceptable warnings to increase driver alertness and safety.
To run this application, you need to have the following installed:
- Python
- Tensorflow
- NumPy
- matplotlib
- face_recognition
- PyObjC
- playsound
You can install NumPy, matplotlib, face_recognition, PyObjC, and playsound using pip:
pip install numpy matplotlib face_recognition PyObjC playsound
To install TensorFlow, you can follow the installation instructions on the TensorFlow website: https://www.tensorflow.org/install
To use the real-time drowsy detection webcam application:
- Start the Jupyter Notebook server by executing the following command in a terminal:
jupyter notebook
- Once the Jupyter Notebook interface is open, navigate to
drowsy_detection_application.ipynb
and open it. - Run all the cells in the notebook.
To classify eye state based on Eye Aspect Ratio (EAR):
- Start the Jupyter Notebook server by executing the following command in a terminal:
jupyter notebook
- Once the Jupyter Notebook interface is open, navigate to
eye_aspect_ratio.ipynb
and open it. - Run all the cells in the notebook.
To run the CNN model:
- Start the Jupyter Notebook server by executing the following command in a terminal:
jupyter notebook
- Once the Jupyter Notebook interface is open, navigate to
cnn_model.ipynb
and open it. - Run all the cells in the notebook.
You can either run a saved model or train a new model.
Running a saved model
- Run
transfer_learning.py
. - Type
1
at the prompt to run the saved model.
Training a new model
- Run
transfer_learning.py
. - Type
2
at the prompt to train a new model.
This application was created by Evangeli Silva [email protected], Andrew Okoro [email protected], Jahnavi Bonagiri [email protected] and Tobin Cherian [email protected] as part of the ICSI 531 course at the University at Albany.