Spaces:
Sleeping
Sleeping
Marcos12886
commited on
Commit
•
8830613
1
Parent(s):
b8ef56d
Update app.py
Browse filestodo funcionando. arreglar fallo readme
app.py
CHANGED
@@ -48,9 +48,9 @@ def predict_stream(audio_path_stream):
|
|
48 |
avg_crying_probability = crying_probabilities.mean()*100
|
49 |
if avg_crying_probability < 15:
|
50 |
label_class = predict(audio_path_stream)
|
51 |
-
return
|
52 |
else:
|
53 |
-
return "No está llorando."
|
54 |
|
55 |
def decibelios(audio_path_stream):
|
56 |
with torch.no_grad():
|
@@ -69,8 +69,8 @@ def mostrar_decibelios(audio_path_stream, visual_threshold):
|
|
69 |
def predict_stream_decib(audio_path_stream, visual_threshold):
|
70 |
db_level = decibelios(audio_path_stream)
|
71 |
if db_level < visual_threshold:
|
72 |
-
llorando = predict_stream(audio_path_stream)
|
73 |
-
return f"{llorando}"
|
74 |
else:
|
75 |
return ""
|
76 |
|
|
|
48 |
avg_crying_probability = crying_probabilities.mean()*100
|
49 |
if avg_crying_probability < 15:
|
50 |
label_class = predict(audio_path_stream)
|
51 |
+
return "Está llorando por:", f"{label_class}. Probabilidad: {avg_crying_probability:.1f}%"
|
52 |
else:
|
53 |
+
return "No está llorando.", f"Probabilidad: {avg_crying_probability:.1f}%"
|
54 |
|
55 |
def decibelios(audio_path_stream):
|
56 |
with torch.no_grad():
|
|
|
69 |
def predict_stream_decib(audio_path_stream, visual_threshold):
|
70 |
db_level = decibelios(audio_path_stream)
|
71 |
if db_level < visual_threshold:
|
72 |
+
llorando, probabilidad = predict_stream(audio_path_stream)
|
73 |
+
return f"{llorando} {probabilidad}"
|
74 |
else:
|
75 |
return ""
|
76 |
|