Real-Time Drowsiness Detection OpenCV Python

Real-Time Drowsiness Detection OpenCV Python – Drowsiness detection is a safety feature that can help prevent accidents caused by drivers who have fallen asleep behind the wheel.

The goal of this intermediate Python project is to create a sleepiness detection system that detects when a person’s eyelids are closed for a short period of time. When drowsiness is detected, this system will notify the driver.

Importance of Real-Time Drowsiness Detection Python OpenCV

Driver drowsiness detection is a vehicle safety feature that helps avoid accidents caused by drowsy driving. According to several studies, weariness is responsible for roughly 20% of all traffic accidents, and up to 50% on particular highways.

Real-Time Drowsiness Detection In Python: Project Details and Technology

Project Name:Real-Time Drowsiness Detection Project In Python With Source Code
AbstractDrowsiness Detection Python OpenCV is a car safety technology which helps prevent accidents caused by the driver getting drowsy.
Language/s Used:Python Deep Learning
Python version (Recommended):3.8/3.9
Type:Desktop Application
Developer:Source Code Hero
Real-Time Drowsiness Detection Project In Python – Project Information

Real-Time Drowsiness Detection OpenCV Python: About the project

This Real-Time Drowsiness Detection OpenCV Python was created with Python OpenCV. Drowsiness Detection is a safety solution that can avoid accidents caused by drivers who fall asleep behind the wheel.

We will use OpenCV to take photos from a camera and feed them into a Deep Learning model that will classify whether the person’s eyes are ‘Open’ or ‘Closed’ in a Drowsiness Detection OpenCV Python project.

This Real-Time Drowsiness Detection In Python also includes a downloadable Python Project With Source Code for free, just find the downloadable source code below and click to start downloading.

By the way, if you are new to Python programming and don’t have any idea what Python IDE is, I have here a list of the Best Python IDE for Windows, Linux, and Mac OS for you. Additionally, I also have here How to Download and Install the Latest Version of Python on Windows.

To start executing a Real-Time Drowsiness Detection OpenCV Python With Source Code, make sure that you have installed Python on your computer.

Real-Time Drowsiness Detection OpenCV Python With Source Code: Steps on how to run the project

Time needed: 5 minutes

These are the steps on how to run Real-Time Drowsiness Detection OpenCV Python With Source Code

  • Step 1: Download Source Code

    First, download the provided source code below.
    drowsiness detection download source code

  • Step 2: Extract File

    Next, after the download finished extract the zip file.
    drowsiness detection extract file

  • Step 3: Import the project to your PyCharm IDE.

    Next, import the source code you’ve download to your PyCharm IDE.
    drowsiness detection open project

  • Step 4: Install all Libraries.

    Next, install all libraries given below.
    drowsiness detection import libraries

  • Step 5: Open cmd.

    Next, click the folder directory of the project and type cmd.
    drowsiness detection open cmd

  • Step 6: Run Project.

    lastly, run the project with the command “py”
    drowsiness detection run project

Download the Source Code below


In this Python project, we have built a drowsy driver alert system that you can implement in numerous ways. We used OpenCV to detect faces and eyes using a haar cascade classifier and then we used a CNN model to predict the status.


If you have any questions or suggestions about the Real-Time Drowsiness Detection OpenCV Python With Source Code, please feel free to leave a comment below.

Leave a Comment