Code Monkey home page Code Monkey logo

distracted-driver-detection's Introduction

Detecting Distracted Drivers

The objective of this work is to successfully predict the likelihood of what a driver is doing in each of the pictures in the dataset1.

The data consists on a set of images, each taken in a car where the driver is doing some action (e.g. texting, talking on the phone, doing their makeup). These are some examples:

The images are labeled following a set of 10 categories:

Class Description
c0 Safe driving.
c1 Texting (right hand).
c2 Talking on the phone (right hand).
c3 Texting (left hand).
c4 Talking on the phone (left hand).
c5 Operating the radio.
c6 Drinking.
c7 Reaching behind.
c8 Hair and makeup.
c9 Talking to passenger(s).

Running the Code

Dependencies

  • Python 3.6.1
  • Tensorflow 1.3.0
  • Keras 2.1.2
  • matplotlib 2.0.2
  • numpy 1.12.1

Command-line Execution

  • Simple CNN in Keras

    Directory Path: /src/keras/base

    • Train the model: python train.py [-h] [--bsize BSIZE]

      Optional arguments:

      -h, --help show help message and exit
      --bsize BSIZE provide batch size for training (default: 40)
    • Test the model: python test.py [-h]

    • Predict from an image: predict.py [-h] [--image IMAGE] [--hide_img]

      Optional arguments:

      -h, --help show help message and exit
      --image IMAGE path to image
      --hide_img do NOT display image on prediction termination
  • CNN with VGG16 Transfered Learning

    Directory Path: /src/keras/vgg

    • Extract VGG16 deep features: python extract_vgg16_features.py [-h]

    • Train the model: python train_top.py [-h]

    • Test the model: python test.py [-h] [--acc] [--cm] [--roc]

      Optional arguments:

      -h, --help show help message and exit
      --acc will calculate loss and accuracy
      --cm will plot confusion matrix
      --roc will plot roc curve
    • Predict from an image: predict.py [-h] [--image IMAGE] [--hide_img]

      Optional arguments:

      -h, --help show help message and exit
      --image IMAGE path to image
      --hide_img do NOT display image on prediction termination

    Note: Since the notebooks may not all be fully updated yet, the best way to run these programs is using the python scripts.



1: This dataset is available on Kaggle, under the State Farm competition Distracted Driver Detection.

distracted-driver-detection's People

Contributors

amihaylo avatar luisarojas 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

Watchers

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