Giter VIP home page Giter VIP logo

distracted-driver-detection's Introduction

Distracted-Driver-Detection

Distracted Driver detection using Keras, MTCNN, OpenCV and Flask.

Watch the video

The dataset used for this project was utilized from kaggle. You can find the original dataset available here : https://www.kaggle.com/c/state-farm-distracted-driver-detection

This dataset consists of thousands of images showing a variety of behaviors exhibited by drivers while driving. From this set, I selected a subset of behaviors which consisted of : Safe Driving, Texting, talking on phone, operating radio, reaching behind. The final size of dataset consisted of 12000 images.

Tools Used: Google Colab, Jupyter Notebook, Eclipse

Workflow:

  1. Trained MobilenetV2 model to recognize the distracted drivers.

  2. Used MTCNN (Multi-task Cascade Convolutional Neural Network) to detect profile face of humans in an image. Reference : https://github.com/ipazc/mtcnn

  3. After detection of human face in an image, predicted the probabilities of the behaviour in the frame using trained model weights.

  4. Deployed the model on flask to generate real time predictions. (Either live camera feed or upload a video)

Files:

model.py : This class will give us the predictions of our previously trained model.

camera.py : This file implements a camera class that does the following operations:

  • Get the image stream from our input (Webcam feed or from video)
  • Detect faces with MTCNN and add bounding boxes
  • Rescale the images and send them to our trained deep learning model
  • get the predictions back from our trained model and add the label to each frame and return the final image stream

main.py : Lastly, our main script will create a Flask app that will render our image predictions into a web page.

distracted-driver-detection's People

Contributors

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