Our Project employs facial landmarks and the eye aspect ratio to detect drowsiness in real-time using a webcam feed. It utilizes the dlib library for face detection and shape prediction, along with essential libraries such as OpenCV, imutils, and pygame for audio alerts.
- scipy.spatial.distance: Computes the Euclidean distance.
- imutils.face_utils: Provides facial landmark indices.
- imutils: Offers convenience functions for OpenCV.
- dlib: A toolkit for machine learning and computer vision.
- pygame: Used for playing an audio alert when drowsiness is detected.
- cv2: OpenCV library for computer vision.
- Python : 3.11
- Pycharm 2023.2.23
- Download Cmake for Dlib Library make sure to tick "add to env path" Cmake 3.28.1
- Real-time drowsiness detection using facial landmarks.
- Audio alert using pygame when drowsiness is detected.
- Saves a screenshot with a timestamp to a specified folder during an alert.
- Create a virtual environment (optional but recommended):
python -m venv venv
- Install dependencies:
pip install -r requirements.txt
Start the development server:
python Drowsiness_Detection.py
Run The "run_project.bat" it Will Install The Dependencies & Creates The "env"
Stay alert and drive safely!