Spaces:
Runtime error
Runtime error
Commit
·
e277959
1
Parent(s):
f1c1345
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,6 @@ import pandas as pd
|
|
9 |
import plotly.express as px
|
10 |
model = keras.models.load_model('emotion.h5')
|
11 |
labels = ['Angry', 'Disgusted', 'Fearful', 'Happy', 'Neutral', 'Sad', 'Suprised']
|
12 |
-
# def load()
|
13 |
-
|
14 |
def predict(audio):
|
15 |
wave, sr = librosa.load(audio, sr=None)
|
16 |
segment_dur_secs = 3
|
@@ -66,7 +64,9 @@ title = "Emotion recognition"
|
|
66 |
description = "This model can shows how speaker emotion changes over the speech"
|
67 |
|
68 |
infr = gr.Interface(fn=predict,
|
69 |
-
inputs=gr.Audio(type="filepath"
|
|
|
|
|
70 |
outputs=outputs,
|
71 |
title=title,description=description,interpretation='default',)
|
72 |
infr.launch()
|
|
|
9 |
import plotly.express as px
|
10 |
model = keras.models.load_model('emotion.h5')
|
11 |
labels = ['Angry', 'Disgusted', 'Fearful', 'Happy', 'Neutral', 'Sad', 'Suprised']
|
|
|
|
|
12 |
def predict(audio):
|
13 |
wave, sr = librosa.load(audio, sr=None)
|
14 |
segment_dur_secs = 3
|
|
|
64 |
description = "This model can shows how speaker emotion changes over the speech"
|
65 |
|
66 |
infr = gr.Interface(fn=predict,
|
67 |
+
inputs=gr.Audio(type="filepath"),
|
68 |
+
examples=['audio_samples/1.mp3','audio_samples/2.mp3','audio_samples/3.mp3','audio_samples/4.mp3']
|
69 |
+
cache_examples=True,
|
70 |
outputs=outputs,
|
71 |
title=title,description=description,interpretation='default',)
|
72 |
infr.launch()
|