Update app.py
Browse files
app.py
CHANGED
@@ -13,22 +13,20 @@ def save_uploaded_file(uploaded_file):
|
|
13 |
f.write(uploaded_file.getbuffer())
|
14 |
return file_path
|
15 |
|
16 |
-
def emotion(
|
17 |
-
if
|
18 |
-
# Save the uploaded file to a temporary location
|
19 |
-
file_path = save_uploaded_file(uploaded_file)
|
20 |
# Classify the file
|
21 |
out_prob, score, index, text_lab = classifier.classify_file(file_path)
|
22 |
# Display the output
|
23 |
st.write(text_lab)
|
24 |
else:
|
25 |
-
st.write("Please
|
26 |
|
27 |
def main():
|
28 |
st.title("Emotion Recognition")
|
29 |
-
|
30 |
-
if
|
31 |
-
emotion(
|
32 |
|
33 |
if __name__ == "__main__":
|
34 |
main()
|
|
|
13 |
f.write(uploaded_file.getbuffer())
|
14 |
return file_path
|
15 |
|
16 |
+
def emotion(file_path):
|
17 |
+
if file_path:
|
|
|
|
|
18 |
# Classify the file
|
19 |
out_prob, score, index, text_lab = classifier.classify_file(file_path)
|
20 |
# Display the output
|
21 |
st.write(text_lab)
|
22 |
else:
|
23 |
+
st.write("Please provide the path to an audio file.")
|
24 |
|
25 |
def main():
|
26 |
st.title("Emotion Recognition")
|
27 |
+
file_path = st.text_input("Enter the path of the audio file (e.g., /path/to/audio.wav):")
|
28 |
+
if file_path:
|
29 |
+
emotion(file_path)
|
30 |
|
31 |
if __name__ == "__main__":
|
32 |
main()
|