Git Product home page Git Product logo

nishagandhi / drowsydriverdetection Goto Github PK

View Code? Open in Web Editor NEW
112.0 4.0 36.0 22.93 MB

This is a project implementing Computer Vision and Deep Learning concepts to detect drowsiness of a driver and sound an alarm if drowsy.

Home Page: https://youtu.be/3uMlNuXfNfc

Python 92.41% Shell 7.59%
drowsy-driver-warning-system computer-vision machine-learning deep-learning neural-network lstm lstm-neural-networks lstm-cells rnn keras

drowsydriverdetection's Introduction

DrowsyDriverDetection

This is a project implementing Computer Vision and Deep Learning concepts to detect drowsiness of a driver and sound an alarm if drowsy.

Youtube Demo : https://youtu.be/3uMlNuXfNfc

• Built a model for drowsiness detection of a driver by real-time Eye-Tracking in videos using Haar Cascades and CamShift algorithm.

• Used the significant features for each video frame extracted by CNN from the final pooling layer to stitch as a sequence of feature vectors for consecutive frames.

• This sequence (2048-D) is given as an input to Long Short-Term Memory (LSTM) Recurrent Neural Networks (RNN), which predicts the drowsiness of the driver given the video sequence and sounds an alarm in such a case.

• Optimized network weights by Adam Optimization algorithm.

Technologies used: Python 2.7, OpenCV 3.3.0, Tensorflow, Keras, CNN, RNN, LSTM.

Steps to run this project:

  1. Run the run_extract_eyes.sh program to track the eyes for different videos(training data) and to store the patches of the eyes in a folder for every video. (Alert and Drowsy)
  2. Use this training data to retrain the CNN model(Inception V3 model).
  3. Run extract_features.py to extract the features from the second last layer of the CNN model which is a 2048-d vector and to create a sequence of frames as a single vector to be given as an input to the LSTM which is a part of Recurrent Neural Networks(RNN)
  4. Run data.py and models.py
  5. Finally run train.py to get the final predictions for the test sequence of data and the alarm will sound if the model predicts the sequence to be in a drowsy state.

drowsydriverdetection's People

Contributors

nishagandhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

drowsydriverdetection's Issues

Data sampling strategy

Hello Nisha, Thanks for sharing your work. It's great. I am working on the same topic of Driver drowsiness detection.
My dataset has 25fps and labeling of drowsy or alert is done in every 2 minutes.I want to stick to a window size of 25.
Which of the below 2 methods is a better way of sampling data??

  • Should I consider the sequential frames from 119sec-120sec for classification ?? OR
  • Should I consider every 120th frame(every 5th second) for classifying drowsy or alert??

I see that your input has a window size of 26. So where these frames collected sequentially or after regular intervals of time?

Model on a video

Hey, I am not too sure how to run this in realtime. Help would be appreciated.

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.