simran0608 commited on
Commit
42a1801
·
verified ·
1 Parent(s): ed25508

Update src/drowsiness_detection.py

Browse files
Files changed (1) hide show
  1. src/drowsiness_detection.py +4 -4
src/drowsiness_detection.py CHANGED
@@ -13,11 +13,11 @@ import os
13
  # --- INITIALIZE MODELS AND CONSTANTS ---
14
 
15
  # Haar cascade classifier for face detection
16
- haar_cascade_face_detector = "dependencies/haarcascade_frontalface_default.xml"
17
  face_detector = cv.CascadeClassifier(haar_cascade_face_detector)
18
 
19
  # Dlib facial landmark detector
20
- dlib_facial_landmark_predictor = "dependencies/shape_predictor_68_face_landmarks.dat"
21
  landmark_predictor = dlib.shape_predictor(dlib_facial_landmark_predictor)
22
 
23
  # Important Variables
@@ -45,8 +45,8 @@ head_down_alert = False
45
 
46
  # --- AUDIO SETUP (using Pygame) ---
47
  pygame.mixer.init()
48
- drowsiness_sound = pygame.mixer.Sound("dependencies/audio/drowsiness-detected.mp3")
49
- yawn_sound = pygame.mixer.Sound("dependencies/audio/yawning-detected.mp3")
50
  # head_down_sound = pygame.mixer.Sound("dependencies/audio/head-down-detected.mp3")
51
 
52
  # --- CORE FUNCTIONS ---
 
13
  # --- INITIALIZE MODELS AND CONSTANTS ---
14
 
15
  # Haar cascade classifier for face detection
16
+ haar_cascade_face_detector = "haarcascade_frontalface_default.xml"
17
  face_detector = cv.CascadeClassifier(haar_cascade_face_detector)
18
 
19
  # Dlib facial landmark detector
20
+ dlib_facial_landmark_predictor = "shape_predictor_68_face_landmarks.dat"
21
  landmark_predictor = dlib.shape_predictor(dlib_facial_landmark_predictor)
22
 
23
  # Important Variables
 
45
 
46
  # --- AUDIO SETUP (using Pygame) ---
47
  pygame.mixer.init()
48
+ drowsiness_sound = pygame.mixer.Sound("drowsiness-detected.mp3")
49
+ yawn_sound = pygame.mixer.Sound("yawning-detected.mp3")
50
  # head_down_sound = pygame.mixer.Sound("dependencies/audio/head-down-detected.mp3")
51
 
52
  # --- CORE FUNCTIONS ---