THP2903 commited on
Commit
7cfcc8b
·
verified ·
1 Parent(s): 46da3ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -155,12 +155,12 @@ def predict_emotion(video_path, audio_path):
155
 
156
 
157
 
158
- predicted_label = predict_emotion(video_path, audio_path)
159
- emotion_dict = {0: 'neutral', 1: 'calm', 2: 'happy', 3: 'sad', 4: 'angry', 5: 'fearful'}
160
 
161
  # Định nghĩa giao diện Gradio
162
 
163
  def predict_emotion_gradio(video, audio):
 
164
  predicted_label = predict_emotion(video, audio)
165
  predicted_emotion = emotion_dict[predicted_label]
166
  return predicted_emotion
@@ -177,7 +177,8 @@ def predict_emotion_gradio(video, audio):
177
  iface = gr.Interface(
178
  fn=predict_emotion_gradio,
179
  inputs=[
180
- gr.Video(label="Upload a video"),
 
181
  gr.Audio(label="Upload a audio")
182
  ],
183
  outputs=gr.Textbox(label="Predicted Emotion"),
 
155
 
156
 
157
 
158
+
 
159
 
160
  # Định nghĩa giao diện Gradio
161
 
162
  def predict_emotion_gradio(video, audio):
163
+ emotion_dict = {0: 'neutral', 1: 'calm', 2: 'happy', 3: 'sad', 4: 'angry', 5: 'fearful'}
164
  predicted_label = predict_emotion(video, audio)
165
  predicted_emotion = emotion_dict[predicted_label]
166
  return predicted_emotion
 
177
  iface = gr.Interface(
178
  fn=predict_emotion_gradio,
179
  inputs=[
180
+ gr.Video(label="Upload a video"
181
+ ),
182
  gr.Audio(label="Upload a audio")
183
  ],
184
  outputs=gr.Textbox(label="Predicted Emotion"),