Professional Documents
Culture Documents
PPT Drowsiness Detection
PPT Drowsiness Detection
Detection System
KUNAL KUMAR SINGH 2105555
ABHINAV THAKUR-2105513
ABHINASH DAS-2105514
PIYUSH SHAW-21051750
NITISH KUMAR-21051665
Under the Supervision of SUCHISMITA DAS
2. Motivation.
3. Existing System.
4. Proposed System.
6. Code Executed.
7. Conclusion.
8. Future Enhancement.
01
Introduction
Introduction
● Overview of the problem of Drowsy Driving :
● Driving while drowsy or asleep is a significant public health issue that poses a serious threat to road safety worldwide.
● According to the National Highway Traffic Safety Administration (NHTSA), drowsy driving is responsible for approximately
91,000 car crashes and 800 deaths each year in the India alone.
● As a result, there has been a significant effort to develop sleep detection systems that can help prevent accidents related to
fatigue and sleepiness.
● To achieve this goal, we conducted a comprehensive review of the existing literature on drowsiness detection and explored
different methods for detecting drowsiness, including physiological measures such as eye movements, yawning and facial
expressions.
Introduction
● In our report, we provide an overview of the existing literature on drowsiness detection and describe the
methodology we used in our study.
● We present the results of our experiments and discuss the implications of our findings for drowsiness detection
and road safety.
02
Motivation
Motivation
● Our project has the potential to contribute significantly to the development of more effective
drowsiness detection systems that can help reduce the number of accidents caused by fatigue and
sleepiness.
● We believe that the development of a reliable and accurate drowsiness detection system can play a
critical role in enhancing road safety and reducing the number of accidents related to driver fatigue.
● Our project's findings have important implications for public health and can help inform the design
of more effective drowsiness detection systems that can be deployed in real-world driving scenarios.
● Overall, our project represents a significant step towards improving road safety and reducing the
incidence of accidents related to drowsy driving.
03
Existing System
Existing System
● By using a non intrusive machine vision based concepts, drowsiness of the driver detected system is
developed. Many existing systems require a camera which is installed in front of driver.
● The openCV detector detects only 40% of face of driver in normal driving position in video recording of
10 minutes.
● Eye Blink detector, which uses a goggle frame to detect the blink time of the eye which is proved not be
comfortable for the driver to wear it all the time.
● Alarm System.
● SMS Alert.
05
Design And
Implementation
Design And Implementation
● Detecting the face in the captured frame and drawing a rectangle around it.
● If the person is not blinking their eyes for a certain period, the code assumes that the person is sleeping and plays the
alert sound file and sends an SMS.
Design And Implementation
● Importing necessary libraries - OpenCV, NumPy, Dlib, imutils, pygame, and twilio.
● Defining a function to compute the distance between two points using the NumPy library.
● If the person is blinking their eyes at a slow rate, the code assumes that the person is drowsy and plays the alert sound
file.
● If the person is active and not blinking their eyes, the code assumes that the person is alert.
● Showing the captured frame and the detected face in a separate window.
● Exiting the program when the user presses the "Esc" key.
06
Code Executed
Code Executed
# Checking if it is blinked
# Initializing the face detector and landmark detector if (ratio > 0.25):
detector = dlib.get_frontal_face_detector() return 2
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") elif (ratio > 0.21 and ratio <= 0.25):
return 1
else:
# status marking for current state return 0
sleep = 0
drowsy = 0 def send_sms():
active = 0 client = Client(keys.account_sid,
status = "" keys.auth_token)
color = (0, 0, 0) message = client.messages.create(
def compute(ptA, ptB): body="Drowsiness Detected !!!",
dist = np.linalg.norm(ptA - ptB) from_=key.twilio_number,
return dist to=key.target_number
)
return message
Code Executed
pygame.mixer.init()
# load alert sound file
alert_sound1 = pygame.mixer.Sound('a3.wav')
alert_sound2 = pygame.mixer.Sound('a4.wav') # The numbers are actually the landmarks which will show
eye
while True: left_blink = blinked(landmarks[36], landmarks[37],
_, frame = cap.read() landmarks[38], landmarks[41],
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) landmarks[40], landmarks[39])
right_blink = blinked(landmarks[42], landmarks[43],
faces = detector(gray) landmarks[44], landmarks[47],
# detected face in faces array landmarks[46], landmarks[45])
for face in faces:
x1 = face.left()
y1 = face.top() # Now judge what to do for the eye blinks
x2 = face.right() if (left_blink == 0 or right_blink == 0):
y2 = face.bottom() sleep += 1
drowsy = 0
active = 0
face_frame = frame.copy() if (sleep > 6):
cv2.rectangle(face_frame, (x1, y1), (x2, y2), (0, 255, status = "SLEEPING !!!"
0), 2) color = (255, 0, 0)
alert_sound1.play()
send_sms()
landmarks = predictor(gray, face)
landmarks = face_utils.shape_to_np(landmarks)
Code Executed
elif (left_blink == 1 or right_blink == 1):
sleep = 0
active = 0
drowsy += 1
if (drowsy > 6):
status = "Drowsy !"
color = (0, 0, 255)
alert_sound2.play()
● In conclusion, the driver drowsiness detection system using Python is an important tool that can
help prevent accidents caused by drowsy driving.
● It is an innovative and effective way to detect early signs of drowsiness and alert drivers to take a
break or pull over to ensure their safety and the safety of others on the road.
● Furthermore, it highlights the importance of getting enough quality sleep to maintain overall
health and well-being and to prevent accidents caused by sleep deprivation and drowsy driving.
08
Future Enhancement
Future Enhancement
● Doziness discovery technology has numerous implicit operations in the future, particularly in
areas related to transportation and safety.
● One of the most important operations is in the field of transportation, where drowsiness
discovery systems can be used to warn motorists, aviators, and other drivers of vehicles when
they're getting too tired to perform their tasks safely.
● This can help prevent accidents caused by motorist fatigue, which is a leading cause of business
accidents.
Thanks!