Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -103,6 +103,7 @@ if st.button("Grabando..."):
|
|
103 |
modelo_sb = cargar_modelo_speechbrain()
|
104 |
|
105 |
|
|
|
106 |
|
107 |
|
108 |
if audio_file is not None:
|
@@ -142,20 +143,21 @@ if audio_file is not None:
|
|
142 |
|
143 |
|
144 |
from speechbrain.inference.classifiers import EncoderClassifier
|
|
|
145 |
|
146 |
-
print("Identificando Audio...")
|
147 |
# Convertir a WAV
|
148 |
wav_path = convertir_a_wav(audio_file)
|
149 |
|
150 |
# Clasificar con SpeechBrain
|
151 |
prediccion = modelo_sb.classify_file(wav_path)
|
152 |
-
clase_predicha = prediccion[3][0]
|
153 |
st.markdown(f"**Predicci贸n del modelo:** {clase_predicha}")
|
154 |
|
155 |
-
if clase_predicha == "siren":
|
156 |
-
st.warning("Sirena detectada en el audio
|
157 |
else:
|
158 |
st.info("No se detect贸 sirena en el audio.")
|
159 |
|
160 |
|
|
|
161 |
|
|
|
103 |
modelo_sb = cargar_modelo_speechbrain()
|
104 |
|
105 |
|
106 |
+
st.write("Tiempo estimado de procesamiento: 15 seg")
|
107 |
|
108 |
|
109 |
if audio_file is not None:
|
|
|
143 |
|
144 |
|
145 |
from speechbrain.inference.classifiers import EncoderClassifier
|
146 |
+
st.audio(audio_file, format='audio/mp3')
|
147 |
|
|
|
148 |
# Convertir a WAV
|
149 |
wav_path = convertir_a_wav(audio_file)
|
150 |
|
151 |
# Clasificar con SpeechBrain
|
152 |
prediccion = modelo_sb.classify_file(wav_path)
|
153 |
+
clase_predicha = prediccion[3][0]
|
154 |
st.markdown(f"**Predicci贸n del modelo:** {clase_predicha}")
|
155 |
|
156 |
+
if clase_predicha.lower() == "siren":
|
157 |
+
st.warning("Sirena detectada en el audio.!!!!!")
|
158 |
else:
|
159 |
st.info("No se detect贸 sirena en el audio.")
|
160 |
|
161 |
|
162 |
+
|
163 |
|