Facial Analysis: Drowsiness Detection

This project focuses on facial analysis using the MediaPipe library to detect facial landmarks and the OpenCV library to capture real-time images from the webcam. The goal of the project is to create an algorithm capable of identifying if people are drowsy based on facial features.

The project uses two research papers, which conclude that people who blink less than 10 times per minute are likely to be drowsy, and that partially open eyes also indicate drowsiness. Using the facial landmarks of the eyes obtained through MediaPipe, a blink counter per minute is created, and the Eye Aspect Ratio (EAR) is calculated. If the blink rate is below 10 blinks per minute and the eyes have a low EAR, an alert is generated indicating that the user might be drowsy. The code also includes a calculation for the Mouth Aspect Ratio (MAR) to indicate yawning. A high MAR suggests that the user yawned, which also signifies potential drowsiness.

The project focuses on the following:
- Understand how to integrate the webcam with Python code using the OpenCV library.
- Learn about the Face Mesh solution from the open-source framework MediaPipe.
- Discover how to perform face detection with MediaPipe.
- Understand facial landmarks and how to manipulate them.
- Build a drowsiness classifier algorithm.

Developed: apr, 2024

Published: jul 15, 2024