Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -148,7 +148,8 @@ def predict_emotion_with_chat(video_path):
|
|
| 148 |
client.connect('http://localhost:5000/chat')
|
| 149 |
|
| 150 |
# Send the predicted emotion to the chat server
|
| 151 |
-
client.emit('message', {'client': 'Emotion Recognition', 'message'
|
|
|
|
| 152 |
|
| 153 |
# Receive messages from the chat server
|
| 154 |
for msg in client.events:
|
|
@@ -165,7 +166,7 @@ iface = gr.Interface(
|
|
| 165 |
gr.Image(label="Last Frame"),
|
| 166 |
gr.Audio(label="Audio"),
|
| 167 |
gr.Textbox(label="Predicted Emotion"),
|
| 168 |
-
gr.
|
| 169 |
],
|
| 170 |
title="Emotion Recognition with Chat",
|
| 171 |
description="Upload a video and get the predicted emotion. Chat with others in real-time."
|
|
|
|
| 148 |
client.connect('http://localhost:5000/chat')
|
| 149 |
|
| 150 |
# Send the predicted emotion to the chat server
|
| 151 |
+
client.emit('message', {'client': 'Emotion Recognition', 'message'
|
| 152 |
+
: f'Predicted emotion: {predicted_emotion}'})
|
| 153 |
|
| 154 |
# Receive messages from the chat server
|
| 155 |
for msg in client.events:
|
|
|
|
| 166 |
gr.Image(label="Last Frame"),
|
| 167 |
gr.Audio(label="Audio"),
|
| 168 |
gr.Textbox(label="Predicted Emotion"),
|
| 169 |
+
gr.Chatbot(label="Chat")
|
| 170 |
],
|
| 171 |
title="Emotion Recognition with Chat",
|
| 172 |
description="Upload a video and get the predicted emotion. Chat with others in real-time."
|