Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,6 +26,12 @@ secrets = {
|
|
| 26 |
detector = get_detector(config)
|
| 27 |
alerter = get_alerter(config, secrets["gemini_api_key"])
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# --- Audio Processing for Gradio ---
|
| 30 |
# Gradio's gr.Audio component needs a specific format: (sample_rate, numpy_array)
|
| 31 |
def process_audio_for_gradio(audio_bytes):
|
|
|
|
| 26 |
detector = get_detector(config)
|
| 27 |
alerter = get_alerter(config, secrets["gemini_api_key"])
|
| 28 |
|
| 29 |
+
geo_settings = config.get('geometric_settings', {})
|
| 30 |
+
drowsiness_levels = geo_settings.get('drowsiness_levels', {})
|
| 31 |
+
SLIGHTLY_DROWSY_DEFAULT = drowsiness_levels.get('slightly_drowsy_threshold', 0.3)
|
| 32 |
+
VERY_DROWSY_DEFAULT = drowsiness_levels.get('very_drowsy_threshold', 0.8)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
# --- Audio Processing for Gradio ---
|
| 36 |
# Gradio's gr.Audio component needs a specific format: (sample_rate, numpy_array)
|
| 37 |
def process_audio_for_gradio(audio_bytes):
|