Code Monkey home page Code Monkey logo

binary-beasts's Introduction

Driver-Drowsiness Detection

Team name: Binary Beasts

Team members

Mentors

  • Priyesh Vakharia
  • Parth Shah
  • Saif Kazi

Table of Contents

Description

This Project is a combination of computer vision , front-end and back-end development . In this with the help of a web camera a continous image (known as video) is taken as input and with the help of some eucledian mathematics , algorithims , inbuilt packages and models of python , if the user is found to be sleepy/drowsy an alarm beeps making the user aware of conditions so that proper care can be taken of his/her sleepy situation.

It has an accuracy of approximately 95% and a reaction time of less than 1 second making it efficient.

It can also be used by students to keep themselves awake while studing as the alarm will wake them up whenever they feel drowsy allowing them to continue their studies without any tension of drowsing off.

Few Code snippets:

  • To get face landmarks-
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat')

def detect_shape(self, gray, rect, predictor):
   shape = predictor(gray, rect)
   shape = face_utils.shape_to_np(shape)
   return shape
   
shape = obj.detect_shape(gray, rect, predictor)
  • To calculate euclidean distance-
def calculate_ratio(eye):
    A = d.euclidean(eye[1], eye[5])
    B = d.euclidean(eye[2], eye[4])
    C = d.euclidean(eye[0], eye[3])
    ratio = (A + B) / (2.0 * C)
    return ratio

Technology stack

Tools and technologies that you learnt and used in the project.

  1. Python
  2. Machine Learning
  3. OpenCV
  4. Javascript
  5. HTML
  6. CSS (basic)

Project Setup

See SETUP.md for the installation steps.

Usage

Clone the repo

$ git clone https://github.com/Bhumika-Kothwal/Binary-Beasts.git

Run the webapp.py file using the command -

$ python webapp.py

Go to the link which shows on terminal.

Click here to understand how to go about with the web-app.

File Structure

    .  
    ├── screenshots                         # contains screenshot of the project
    ├── fonts 
    ├── img 
    ├── mail 
    ├── alarm.wav                           # alarm file
    ├── shape_predictor_68_face_landmarks   # dlib classifier to detect facial landmarks
    ├── static                   
    │   ├── js                              # contains .js files    
    │   ├── styles                          # contains .css files       
    │   └── demo.mp4                        # contains demo of our project          
    ├── templates                           # conatins HTML pages  
    │   ├── demo.html                       # contains demo video
    │   ├── start.html                      # live drowsiness detection page
    │   └── index.html                      # home page
    ├── drowsiness_detection                # conatins python code    
    │   ├── eye_yawn_detection              # python code for drowsiness detection
    │   └── __init_.py       
    ├── webapp.py                           # conatins server-side Flask code   
    ├── SETUP.md                            # contains installation instructions of different modules
    └── README.md                          

Applications

It can be used to detect if a driver is drowsy or not during driving and plays alarm if the driver is drowsy resulting in prevention of accidents.

It can also be used by students to keep themselves awake while studying as the alarm will wake them up whenever they feel drowsy allowing them to continue their studies without any tension of drowsing off.

Future scope

The project now uses the web-cam to capture the images of driver to process upon. Further work includes -

  • Providing feature to capture images using Raspberry-Pi or other external camera
  • Building this model into a hardware which can be directly fixed onto a place
  • Making this into a web-application and can be used by any external server as well

Screenshots

To be awake is to be alive!! Screenshot

binary-beasts's People

Contributors

bhumika-kothwal avatar donovan-crasta avatar nishtha2709 avatar pratamjain 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.