REPOSITORY OVERVIEWLive repository statistics
★ 0Stars
⑂ 0Forks
◯ 0Open issues
◉ 0Watchers
40/100
OPENREPOHUB HEALTH SIGNALLimited signals
A transparent discovery signal based on current public GitHub metadata.
Recent activity35% weight
10 Community adoption25% weight
0 Maintenance state20% weight
100 License clarity10% weight
100 Project information10% weight
67 This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
README preview
Drowsiness Detection System
This project implements a Drowsiness Detection System using Python, OpenCV, and dlib. The system monitors a user's eye aspect ratio (EAR) through a webcam feed to detect signs of drowsiness, alerting the user with an alarm sound when drowsiness is detected.
Features
- Real-time Eye Aspect Ratio Calculation: Uses facial landmarks to calculate the EAR for both eyes.
- Drowsiness Alert: Plays an alarm sound when the user's EAR falls below a specified threshold for a set number of frames, indicating potential drowsiness.
- Visual Feedback: Draws the eye contours on the video feed for better visualization.
Requirements
- Python 3.x
- OpenCV
- dlib
- imutils
- pygame
Installation
-
Clone the repository:
git clone <repository-url>
cd drowsiness-detection
-
Install the required packages:
pip install -r requirements.txt
-
Download the pre-trained facial landmark predictor:
- Place the
shape_predictor_68_face_landmarks.dat file inside the models folder.
-
Place an audio file named music.wav in the root directory of the project, which will be used as the alert sound.
Usage
Run the following command to start the drowsiness detection system:
python drowsiness_detection.py
- The system will start capturing the video feed from your webcam.
- If drowsiness is detected, an alert message will appear on the screen, and an alarm sound will play.
- Press
q to exit the program.
Configuration
- Threshold (
thresh): Adjust the EAR threshold value in the code to change the sensitivity of drowsiness detection.
- Frame Check (
frame_check): Change the number of consecutive frames required to trigger the alert.
How It Works
- The program captures video from the webcam.
- It detects faces in the frame and identifies eye regions using facial landmarks.
- The EAR is calculated for both eyes; if the EAR falls below the threshold for a specified number of frames, an alert is triggered.
ALGORITHMICALLY RELATEDSimilar Open-Source Projects
Selected from shared topics, language and repository description—not editorial ratings.
Welcome to our drowsiness detection project using Python and the powerful dlib library! 😴 This repository hosts a user-friendly implementation to detect drowsiness in real-time using your computer's webcam. Our easy-to-understand Python code utilizes the dlib library's advanced facial landmark detection to monitor facial cues and alert users when
49/100 healthActive repository
PythonNo license#dlib-face-detection#drowsy-driver-warning-system#imageprocessing#opencv-python
⑂ 0 forks◯ 0 issuesUpdated Feb 28, 2026