Git Product home page Git Product logo

drowsiness-detection's Introduction

DROWSINESS DETECTION

Introduction

A computer vision system based on opencv that monitors a video stream for driver drowsiness and plays an alarm if the driver appears to be sleepy.

Code Requirements

Python is the programming language used in the example code (version 2.7 and higher will work).

Dependencies

  1. import cv2
  2. import immutils
  3. import dlib
  4. import scipy
  5. import playsound
  6. import queue
  7. import time
  8. import sys

Algorithm

● Based on a modification to the Histogram of Oriented Gradients, we used Linear SVM for classification in combination with a pre-trained frontal face detector from Dlib's library.
● The pre-trained facial landmark detector in the dlib library is used to estimate the position of 68 (x, y)-coordinates that correspond to facial structures on the face. The following figure illustrates the 68 landmark output. We used the 70 landmark model, however.

image

● The aspect ratio is then calculated to see if the eyes are open or closed.
● If the Eye Aspect Ratio is larger than a threshold, the eye is open. (Roughly 0.3)

image

● A blink should last between 200 and 300 milliseconds.
● A sleepy blink would last 800-900 milliseconds.

eye_aspect_ratio

Application

It can be used by riders who tend to drive for longer periods, where drowsines could result in accidents.

drowsiness-detection's People

Contributors

deepti-96 avatar

Watchers

 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.