abrar-adnan commited on
Commit
964aa5f
·
1 Parent(s): 79b2a39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -161,6 +161,17 @@ def video_processing(video_file, encoded_video):
161
  if emotion_count > 0:
162
  for key in video_emotions.keys():
163
  video_emotions[key] /= emotion_count
 
 
 
 
 
 
 
 
 
 
 
164
  final_result_dict = {
165
  "gaze_percentage" : gaze_percentage,
166
  "face_emotion" : video_emotions,
 
161
  if emotion_count > 0:
162
  for key in video_emotions.keys():
163
  video_emotions[key] /= emotion_count
164
+
165
+
166
+ # Modify 'angry' key to 'anger'
167
+ video_emotions['anger'] = video_emotions.pop('angry')
168
+
169
+ # Modify 'happy' key to 'joy'
170
+ video_emotions['joy'] = video_emotions.pop('happy')
171
+
172
+ # Modify 'sad' key to 'sadness'
173
+ video_emotions['sadness'] = video_emotions.pop('sad')
174
+
175
  final_result_dict = {
176
  "gaze_percentage" : gaze_percentage,
177
  "face_emotion" : video_emotions,