GithubHelp home page GithubHelp logo

tejasnaikk / driverdrowsiness_detection Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 9.0 5.26 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/XFC7BJgYwH4

Python 92.41% Shell 7.59%
computer-vision drowsy-driver-warning-system deep-learning deep-neural-networks rnn recurrent-neural-networks lstm long-short-term-memory-models machine-learning

driverdrowsiness_detection's Introduction

DriverDrowsiness_Detection

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

• 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.

Youtube Link: https://youtu.be/XFC7BJgYwH4

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

driverdrowsiness_detection's People

Contributors

tejasnaikk avatar

Stargazers

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

Watchers

 avatar

driverdrowsiness_detection's Issues

Data sampling strategy

Hi Tejas , 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?

Pool_3:0 does not exist in the graph and SavedModel file does not exist in the graph

Hello,
I am trying to run the code but I am facing some errors. I hope that you would help me with the solution.
I have successful done with Inceptionv3 model but while running the Extracting_features_mobile.py there was error which is as follows
Pool_0:3 does not exist in the graph and
while running the import_pb_to_tensorboard.py there were also an error which is
raise IOError("SavedModel file does not exist at: %s" % saved_model_dir)
OSError: SavedModel file does not exist at: E:\tmp\output_graph.pb
Please help me in solving these two
Thanks in advance

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.