GithubHelp home page GithubHelp logo

ioanachelaru / drowsiness-detection-system Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 174.15 MB

Python 93.80% C++ 0.78% C 1.40% Fortran 0.05% PowerShell 0.11% Batchfile 0.01% Jupyter Notebook 3.84%
drowsy-driver-warning-system drowsiness-detection machine-learning computer-vision convolutional-neural-network python tensoflow

drowsiness-detection-system's Introduction

Drowsiness detection with OpenCV and CNN

The poject is build to detect early signs of fatigue for drivers based on their eye movement using a real-time video stream and playing an alarm when the divers appears to be drowsy.

Dependencies

The project uses cv2, keras and tensoflow. All the required dependencies can be found in requirements.txt.

Algorithm

The face is detected using haar-like features since is a quick and efficient enough method and the eyes are detected using dlib's shape_predictor_68_face_landmarks.dat because is a more effective method than the previous one.

If both eyes are detected they are passed to a convolutional neural network build and trained for their classification.

If both eyes are classified as closed, a counter will increase its value, otherwise, it will be decreased. When the counter reaches a threshold, the driver will be declared drowsy, an alarm will start ringing, and a red border will be added to the application's window. The alarm will stop and the border will disappear when the value of the counter will be again smaller than the threshold.

The Convolutional neural network

It was built and trained using Google Colaboratory and a dataset of around 3000 images of open and closed left eyes.

The CNN has been trained with only left eyes, that way creating a binary classifier since we're not interested in differentiating the right from the left eye. For that reason, before sending the segment containing the right eye detected, a flip operation is applied over it so it simulates the left eye distribution.

drowsiness-detection-system's People

Contributors

ioanachelaru avatar

Stargazers

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