File size: 1,967 Bytes
19f420a
f37553c
19f420a
f37553c
19f420a
 
 
 
 
 
 
 
 
4ea318f
2c88fb0
98c37cb
 
2c88fb0
98c37cb
2c88fb0
98c37cb
 
2c88fb0
f37553c
98c37cb
 
 
 
 
 
 
19f420a
f37553c
19f420a
 
 
 
f37553c
19f420a
 
704417d
19f420a
704417d
 
 
 
 
19f420a
 
 
 
1b0f2e7
19f420a
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# config.yaml
# -----------------------------------------------------------------------------
# Main configuration file for the Drive Paddy application.
# -----------------------------------------------------------------------------

# -- Detection Strategy --
# Sets the active drowsiness detection method.
# Options: "geometric", "cnn_model", "hybrid"
detection_strategy: "geometric"

# -- Geometric Strategy Settings --
# Parameters for the facial landmark-based detection methods.
geometric_settings:
  downsize_factor: 0.5
  skip_frames: 1
  low_light_thresh: 60
  eye_ar_thresh: 0.24            # Increased: Catches squinting
  eye_ar_consec_frames: 5     # Decreased: Faster eye closure detection
  yawn_mar_thresh: 0.5           # Decreased: Catches smaller yawns
  yawn_consec_frames: 5         # Decreased: Faster yawn detection
  head_nod_thresh: 15.0          # Decreased: Catches smaller nods
  head_look_away_thresh: 18.0    # Decreased: Catches smaller head turns
  head_pose_consec_frames: 5  # Decreased: Faster head pose detection
  indicator_weights:
    eye_closure: 1
    yawning: 1
    head_nod: 1
    looking_away: 1
  drowsiness_levels:
    slightly_drowsy_threshold: 1 # Unchanged, as it's the minimum
    very_drowsy_threshold: 2     # Could be left at 2, or lowered to 1.5 if using fractional weights

# -- CNN Model Settings (Not used in 'geometric' mode) --
cnn_model_settings:
  model_path: "models/best_model_efficientnet_b7.pth"
  confidence_thresh: 0.8

# -- Hybrid Strategy Settings (Not used in 'geometric' mode) --
hybrid_settings:
  alert_threshold: 1.0
  # CORRECTED: Each weight is now on its own line.
  weights:
    eye_closure: 0.45
    yawning: 0.30
    head_nod: 0.55
    looking_away: 0.25
    cnn_prediction: 0.60

# -- Alerting System --
alerting:
  alert_sound_path: "assets/alert.wav"
  alert_cooldown_seconds: 5 # Increased cooldown to prevent alert fatigue

# -- Gemini API (Optional) --
gemini_api:
  enabled: true