Giter VIP home page Giter VIP logo

darkogligorijevic / drowsiness-detection-alert Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 176.89 MB

A Python-based computer vision project that detects drowsiness using facial landmarks.

License: MIT License

Python 85.32% C 2.41% Cython 4.98% C++ 0.20% Meson 0.01% Fortran 0.16% Forth 0.01% CSS 0.08% JavaScript 0.09% HTML 6.71% PowerShell 0.05% Batchfile 0.01%
computer-vision dlib dlib-face-detection drowsiness drowsiness-detection drowsiness-detection-python drowsy-driver drowsy-driver-warning-system eye-aspect-ratio python opencv

drowsiness-detection-alert's Introduction

Drowsiness Detection Alert System

Description

A Python-based computer vision project that detects drowsiness using facial landmarks.

Overview

This project uses OpenCV, dlib, and other libraries to create a real-time drowsiness detection alert system. It analyzes facial landmarks to determine if the eyes are closed. If the eyes are closed, the user will be alerted.

Features

  • Real-time facial landmark detection.
  • Eyes closed detection using the Eye Aspect Ratio (EAR) formula.
  • Drowsiness alert with visual and auditory feedback.

Getting Started

Prerequisites

  • Python 3.x
  • Install dependencies with pip install -r requirements.txt

Usage

  1. Clone the repository:

    git clone https://github.com/your-username/drowsiness-alert.git
    cd drowsiness-detection-alert
  2. Run the main script:

    python main.py
  3. Feel free to test the drowsiness detection alert system.

Dependencies

  • OpenCV
  • dlib
  • scipy
  • pygame

Install dependencies using:

pip install -r requirements.txt

Acknowledgments

  • The facial landmarks predictor model is provided by dlib.

Configuration

The drowsiness detection alert system provides several configuration options that users can adjust to customize the behavior of the alert system. These options include:

  • EAR_THRESHOLD: The threshold for detecting closed eyes.
  • ALERT_DURATION: The duration (in seconds) for triggering the drowsiness detection alert.

To configure these options, users can modify the corresponding constants in the main.py script.

Troubleshooting

If you encounter issues while running the drowsiness deetection alert system, consider the following troubleshooting steps:

  1. Issue: Eyes not detected

    • Solution: Ensure proper lighting conditions and adjust the camera angle for better detection.
  2. Issue: False positives

    • Solution: Tweak the EAR_THRESHOLD constant in the main.py script to fine-tune the sensitivity.

Contributing

Feel free to contribute to this project.

License

This project is licensed under the MIT License.

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.