Skip to content

jil2004/sleep-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Eye Detection with Alarm

This is a Python script that uses OpenCV to detect eyes and sound an alarm if they are closed for more than a minute. This can be used as a safety feature for drivers or others who need to stay alert and focused.

Getting Started

Prerequisites

To run this script, you'll need to have the following installed:

  • Python 3.x
  • OpenCV (cv2) library for Python
  • playsound library for Python

Installing

Python 3.x

You can download Python from the official website: https://www.python.org/downloads/

OpenCV

To install the OpenCV library, you can run the following command:

pip install opencv-python

playsound library

To install the playsound library, you can run the following command: pip install playsound

Running the Script

To run the script, open a terminal or command prompt and navigate to the directory where the script is located. Then, run the following command:

python main.py

This will open up your computer's webcam and start detecting eyes. If the eyes are closed for more than a minute, an alarm will sound.

Exiting the Script

To exit the script, press the 'q' key on your keyboard.

Built With

  • Python - Programming language
  • OpenCV - Open source computer vision library
  • playsound - Pure Python, cross-platform, one-line library used to play sound effects

Acknowledgments

About

opencv based program which helps you keep awake

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages