Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanskaryo/driver-drowsiness-detection-alert
Drowsiness detection system with alert message and voice
https://github.com/sanskaryo/driver-drowsiness-detection-alert
computer-vision dlib-face-detection haarcascade-frontalface numpy opencv pandas raspberry-pi
Last synced: 6 days ago
JSON representation
Drowsiness detection system with alert message and voice
- Host: GitHub
- URL: https://github.com/sanskaryo/driver-drowsiness-detection-alert
- Owner: sanskaryo
- License: mit
- Created: 2024-05-27T08:18:45.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-29T11:31:07.000Z (7 months ago)
- Last Synced: 2024-11-22T06:18:09.481Z (2 months ago)
- Topics: computer-vision, dlib-face-detection, haarcascade-frontalface, numpy, opencv, pandas, raspberry-pi
- Language: Python
- Homepage:
- Size: 71 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Drowsiness Detection System for yawning as well as sleepy eyes π΄ π« π
A real-time drowsiness detection system using computer vision, OpenCV, and other relevant libraries. This system detects when a person is drowsy and alerts them to prevent accidents.
## Features
- Real-time drowsiness detection
- Alerts the user with a sound when drowsiness is detected
- Utilizes facial landmarks to detect eye closure and yawning## How It Works
1. **Facial Landmark Detection**: Uses dlibβs pre-trained shape predictor model to detect facial landmarks. The landmarks around the eyes are used to compute the Eye Aspect Ratio (EAR).
2. **Eye Aspect Ratio (EAR)**: The EAR is calculated based on the distances between the vertical eye landmarks and the horizontal eye landmarks. When the EAR falls below a certain threshold, it indicates that the eyes are closed.
3. **Yawning Detection**: Measures the distance between upper and lower lips to detect yawning, another indicator of drowsiness.
4. **Alert Mechanism**: When drowsiness or yawning is detected for a certain duration, the system triggers an alert sound to wake up the user.## Working images
![Drowsiness Detection Alert](https://github.com/sanskaryo/Drowsiness_detection_using_dlib_and_cv/blob/main/images/WhatsApp%20Image%202024-06-29%20at%2016.21.34_cd625042.jpg)
![Drowsiness Detection Alert](https://github.com/sanskaryo/Drowsiness_detection_using_dlib_and_cv/blob/main/images/WhatsApp%20Image%202024-06-29%20at%2016.25.00_30454b32.jpg)## Requirements
- Python 3.x
- OpenCV
- dlib
- imutils
- scipy
- numpy## Installation
1. **Clone the repository**:
```sh
git clone [email protected]:sanskaryo/Drowsiness_detection_using_dlib_and_cv.git
cd drowsiness-detection-systempython drowsiness_detection.py --webcam 0
### Download the Pre-trained Shape Predictor:
1. **Download the shape predictor and extract the .dat file.**
2. **Place the `shape_predictor_68_face_landmarks.dat` file in the project directory.**This version includes structured sections, improved readability, and direct instructions for installation and usage. Adjust paths and details as necessary for your specific setup.