Skip to content

bkanishka004/drowsiness-detection

Repository files navigation

😴 Drowsiness Detection System using OpenCV and Dlib

This is a Python-based real-time Drowsiness Detection System that uses a webcam to detect signs of drowsiness by monitoring the Eye Aspect Ratio (EAR) through facial landmarks.

If the user's eyes remain closed for a certain number of consecutive frames, the system triggers:

  • 🔔 Beep alarm
  • 🗣️ Voice alert: "Wake up! You're feeling drowsy."

📌 Features

  • Real-time facial landmark detection
  • Eye Aspect Ratio (EAR) calculation
  • Drowsiness alert with beeping sound
  • Text-to-speech voice warning
  • Live webcam visualization with eye landmarks

🛠️ Technologies Used

  • Python 3.11
  • OpenCV
  • Dlib (with shape_predictor_68_face_landmarks.dat)
  • NumPy
  • SciPy
  • Pyttsx3 (text-to-speech)
  • Winsound (for beep alert on Windows)

📸 How It Works

  • The webcam captures live video.
  • Dlib’s 68 facial landmark model locates eyes.
  • The Eye Aspect Ratio (EAR) is computed for each frame.
  • If eyes remain closed beyond a threshold duration, the system:
    • Triggers a beep alert
    • Speaks a voice warning: "Wake up! You're feeling drowsy."

🚗 Real-World Use Case : Driver Drowsiness Detection

🛣️ Problem:

Drowsy driving is a major cause of road accidents due to slow reaction time and loss of alertness.

💡 Solution:

This system works like a safety assistant, continuously monitoring the driver's eyes and alerting them before microsleep causes harm.

📦 Applications:

  • Automotive vehicles (dashboard camera-based alert system)
  • Truck/fleet monitoring systems
  • Railway or aviation crew fatigue detection
  • Industrial workers' safety monitoring

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors