Marcos12886 commited on
Commit
8830613
1 Parent(s): b8ef56d

Update app.py

Browse files

todo funcionando. arreglar fallo readme

Files changed (1) hide show
  1. app.py +4 -4
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 f"Está llorando por: {label_class}"
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