Coder Social home page Coder Social logo

driver-drowsiness-detection's Introduction

Real-time Driver Drowsiness Detection

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.

Prerequisites

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

Usage

To use the real-time drowsy detection webcam application:

  1. Start the Jupyter Notebook server by executing the following command in a terminal:
    jupyter notebook
    
  2. Once the Jupyter Notebook interface is open, navigate to drowsy_detection_application.ipynb and open it.
  3. Run all the cells in the notebook.

Model Training

Eye Aspect Ratio Classification

To classify eye state based on Eye Aspect Ratio (EAR):

  1. Start the Jupyter Notebook server by executing the following command in a terminal:
    jupyter notebook
    
  2. Once the Jupyter Notebook interface is open, navigate to eye_aspect_ratio.ipynb and open it.
  3. Run all the cells in the notebook.

Convolutional Neural Network (CNN) Model

To run the CNN model:

  1. Start the Jupyter Notebook server by executing the following command in a terminal:
    jupyter notebook
    
  2. Once the Jupyter Notebook interface is open, navigate to cnn_model.ipynb and open it.
  3. Run all the cells in the notebook.

Transfer Learning Model

You can either run a saved model or train a new model.

Running a saved model

  1. Run transfer_learning.py.
  2. Type 1 at the prompt to run the saved model.

Training a new model

  1. Run transfer_learning.py.
  2. Type 2 at the prompt to train a new model.

Authors

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.

driver-drowsiness-detection's People

Contributors

evangelisilva avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.