Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,8 +123,11 @@ def predict_emotion_with_chat(video_path):
|
|
| 123 |
|
| 124 |
# Connect to the chat server
|
| 125 |
socketio.emit('message', {'client': 'Emotion Recognition', 'message': f'Predicted emotion: {predicted_emotion}'})
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
-
return last_frame, audio_path, predicted_emotion
|
| 128 |
|
| 129 |
# Gradio Interface
|
| 130 |
iface = gr.Interface(
|
|
@@ -151,5 +154,5 @@ def handle_message(message):
|
|
| 151 |
emit('message', message, broadcast=True)
|
| 152 |
|
| 153 |
if __name__ == '__main__':
|
| 154 |
-
iface.launch()
|
| 155 |
-
socketio.run(app, debug=True)
|
|
|
|
| 123 |
|
| 124 |
# Connect to the chat server
|
| 125 |
socketio.emit('message', {'client': 'Emotion Recognition', 'message': f'Predicted emotion: {predicted_emotion}'})
|
| 126 |
+
|
| 127 |
+
# Get messages from the chat server
|
| 128 |
+
messages = [] # This should be updated with real messages from the server
|
| 129 |
|
| 130 |
+
return last_frame, audio_path, predicted_emotion, messages
|
| 131 |
|
| 132 |
# Gradio Interface
|
| 133 |
iface = gr.Interface(
|
|
|
|
| 154 |
emit('message', message, broadcast=True)
|
| 155 |
|
| 156 |
if __name__ == '__main__':
|
| 157 |
+
iface.launch(share=True)
|
| 158 |
+
socketio.run(app, debug=True)
|