Update app.py
Browse files
app.py
CHANGED
|
@@ -189,9 +189,58 @@ def emotion(file_path):
|
|
| 189 |
|
| 190 |
|
| 191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
audio_examples=["Audio 1.wav","Audio 2.wav","Audio 3.wav","Audio 4.wav","Audio 5.wav"]
|
| 193 |
|
| 194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
|
| 197 |
|
|
|
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
+
|
| 193 |
+
import gradio as gr
|
| 194 |
+
|
| 195 |
+
# Gradio
|
| 196 |
+
audio_title = "Audio Emotion Detector 🎙️"
|
| 197 |
+
|
| 198 |
+
audio_description = gr.Markdown(
|
| 199 |
+
"""Ever wondered what emotions someone's voice might be hiding?
|
| 200 |
+
Prepare to dive into the wild world of vocal emotions with this uproariously entertaining app!
|
| 201 |
+
Just upload an audio clip in WAV or MP3 format, and our trusty emotion detector
|
| 202 |
+
will spill the beans on what kind of emotional rollercoaster ride they're on.
|
| 203 |
+
|
| 204 |
+
## Pro Tip
|
| 205 |
+
Make sure the audio clip captures only their voice for maximum hilarity!
|
| 206 |
+
Let's see if they're serenading with sorrow or belting out bursts of bliss! 🎶
|
| 207 |
+
|
| 208 |
+
And hey, if you're feeling a bit blue yourself, this app is sure to hit all the right notes
|
| 209 |
+
and lift your spirits!""").value
|
| 210 |
+
|
| 211 |
+
audio_article = gr.Markdown(
|
| 212 |
+
"""
|
| 213 |
+
## DISCLAIMER
|
| 214 |
+
This app isn't equipped with psychic powers!
|
| 215 |
+
So, take the results with a pinch of musical humor, or better yet, a dollop of whimsy!
|
| 216 |
+
|
| 217 |
+
## FUN FACT
|
| 218 |
+
Our audio emotion detector was trained on a zany collection of audio clips
|
| 219 |
+
that range from dramatic monologues to cat karaoke concerts! It's not just about the tones;
|
| 220 |
+
it's about the tunes too! 🐱🎤
|
| 221 |
+
|
| 222 |
+
## DATA DELIGHTS
|
| 223 |
+
Did you know our dataset includes a cacophony of audio clips
|
| 224 |
+
in WAV and MP3 formats? It's like tuning into an emotion-filled radio station
|
| 225 |
+
where every frequency is a new adventure in hilarity! 📻
|
| 226 |
+
""").value
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
|
| 231 |
audio_examples=["Audio 1.wav","Audio 2.wav","Audio 3.wav","Audio 4.wav","Audio 5.wav"]
|
| 232 |
|
| 233 |
+
|
| 234 |
+
audio_model=gr.Interface(fn = emotion,
|
| 235 |
+
inputs = gr.Textbox( label='Audio File Path'),
|
| 236 |
+
outputs = gr.Textbox(label='Emotion'),
|
| 237 |
+
title = audio_title,
|
| 238 |
+
examples = audio_examples,
|
| 239 |
+
description = audio_description,
|
| 240 |
+
article=audio_article,
|
| 241 |
+
allow_flagging='never')
|
| 242 |
+
|
| 243 |
+
|
| 244 |
|
| 245 |
|
| 246 |
|