Spaces:
Sleeping
Sleeping
[UPD] app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from sklearn.preprocessing import LabelEncoder
|
|
7 |
from tensorflow.keras.models import load_model
|
8 |
|
9 |
|
10 |
-
le = LabelEncoder()
|
11 |
|
12 |
model = load_model('model/audio_prediction_model')
|
13 |
|
@@ -20,9 +20,9 @@ def prediction_audio(audiofile, model):
|
|
20 |
X = mel_frequency.reshape(1, -1) # (1, 128)
|
21 |
|
22 |
predicted_label = np.argmax(model.predict(X), axis=-1)
|
23 |
-
predicted_class = le.inverse_transform(predicted_label)
|
24 |
|
25 |
-
return
|
26 |
|
27 |
st.title("Détection de coups de feu")
|
28 |
|
|
|
7 |
from tensorflow.keras.models import load_model
|
8 |
|
9 |
|
10 |
+
# le = LabelEncoder()
|
11 |
|
12 |
model = load_model('model/audio_prediction_model')
|
13 |
|
|
|
20 |
X = mel_frequency.reshape(1, -1) # (1, 128)
|
21 |
|
22 |
predicted_label = np.argmax(model.predict(X), axis=-1)
|
23 |
+
# predicted_class = le.inverse_transform(predicted_label)
|
24 |
|
25 |
+
return predicted_label[0]
|
26 |
|
27 |
st.title("Détection de coups de feu")
|
28 |
|