Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,8 +59,34 @@ def classify_audio(audio_file):
|
|
59 |
|
60 |
return dict(zip(categories, map(float, probs)))
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
label = gr.Label()
|
|
|
64 |
# Gradio Interface
|
65 |
-
inf = gr.Interface(fn=classify_audio, inputs=audio, outputs=label)
|
66 |
-
inf.launch()
|
|
|
59 |
|
60 |
return dict(zip(categories, map(float, probs)))
|
61 |
|
62 |
+
description = """
|
63 |
+
# Emotion Recognition from Audio
|
64 |
+
|
65 |
+
Welcome to the app that recognizes emotion from the audio!
|
66 |
+
|
67 |
+
## Instructions:
|
68 |
+
- Upload or record audio (no more than 20 seconds for now)
|
69 |
+
- Wait for processing and prediction from the model.
|
70 |
+
|
71 |
+
## Emotions the app recognizes:
|
72 |
+
1) Anger
|
73 |
+
2) Disgust
|
74 |
+
3) Fear
|
75 |
+
4) Happiness
|
76 |
+
5) Pleasant Surprise
|
77 |
+
6) Sadness
|
78 |
+
7) Neutral
|
79 |
+
|
80 |
+
## About:
|
81 |
+
This application is actually using a computer vision model (an adaptation of ResNet) for detection and the model
|
82 |
+
has been trained on a relatively small dataset of 2,380 recordings from two actors saying phrases in different emotions.
|
83 |
+
|
84 |
+
For more information, visit this [Github repo](https://github.com/KyawHtetWin/issem-machine-learning/tree/main/audio_emotion_detector)
|
85 |
+
"""
|
86 |
+
|
87 |
+
audio = gr.Audio(type="filepath", label="Upload Audio")
|
88 |
label = gr.Label()
|
89 |
+
md = gr.Markdown(description)
|
90 |
# Gradio Interface
|
91 |
+
inf = gr.Interface(fn=classify_audio, inputs=audio, outputs=label, title="Emotion Recognition", description=md)
|
92 |
+
inf.launch(share=True)
|