yunusajib commited on
Commit
8391b54
·
verified ·
1 Parent(s): 3eebee3
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -228,24 +228,25 @@ def process_input(video, audio):
228
  timeline_df = get_emotion_timeline()
229
  advice = get_practitioner_advice(face_emotion, voice_emotion)
230
 
231
- return {
232
- "current_face": face_emotion,
233
- "current_voice": voice_emotion,
234
- "timeline": timeline_df,
235
- "advice": advice,
236
- "face_details": str(face_details),
237
- "voice_details": str(voice_details)
238
- }
 
239
  except Exception as e:
240
  print(f"Processing error: {str(e)}")
241
- return {
242
- "current_face": "Error",
243
- "current_voice": "Error",
244
- "timeline": pd.DataFrame(),
245
- "advice": "System error occurred",
246
- "face_details": "",
247
- "voice_details": ""
248
- }
249
 
250
  # Gradio interface
251
  with gr.Blocks(title="Patient Emotion Recognition", theme="soft") as demo:
 
228
  timeline_df = get_emotion_timeline()
229
  advice = get_practitioner_advice(face_emotion, voice_emotion)
230
 
231
+ # Return values separately instead of as a dictionary
232
+ return (
233
+ face_emotion, # current_face
234
+ voice_emotion, # current_voice
235
+ timeline_df, # timeline
236
+ advice, # advice
237
+ str(face_details), # face_details
238
+ str(voice_details) # voice_details
239
+ )
240
  except Exception as e:
241
  print(f"Processing error: {str(e)}")
242
+ return (
243
+ "Error", # current_face
244
+ "Error", # current_voice
245
+ pd.DataFrame(), # timeline
246
+ "System error occurred", # advice
247
+ "", # face_details
248
+ "" # voice_details
249
+ )
250
 
251
  # Gradio interface
252
  with gr.Blocks(title="Patient Emotion Recognition", theme="soft") as demo: