abrar-adnan commited on
Commit
20429ec
1 Parent(s): add9fb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -8
app.py CHANGED
@@ -125,14 +125,23 @@ def video_processing(video_file, encoded_video):
125
  sad = sad / emotion_count
126
  surprise = surprise / emotion_count
127
  neutral = neutral / emotion_count
 
 
 
 
 
 
 
 
 
128
 
129
- angry = 'total anger percentage' + str(angry)
130
- disgust = 'total disgust percentage' + str(disgust)
131
- fear = 'total fear percentage' + str(fear)
132
- happy = 'total happy percentage' + str(happy)
133
- sad = 'total sad percentage' + str(sad)
134
- surprise = 'total surprise percentage' + str(surprise)
135
- neutral = 'total neutral percentage' + str(neutral)
136
  print(f'total anger percentage = {angry}')
137
  print(f'total disgust percentage = {disgust}')
138
  print(f'total fear percentage = {fear}')
@@ -140,7 +149,7 @@ def video_processing(video_file, encoded_video):
140
  print(f'total sad percentage = {sad}')
141
  print(f'total surprise percentage = {surprise}')
142
  print(f'total neutral percentage = {neutral}')
143
- return str(gaze_percentage)
144
 
145
 
146
  demo = gr.Interface(fn=video_processing,
 
125
  sad = sad / emotion_count
126
  surprise = surprise / emotion_count
127
  neutral = neutral / emotion_count
128
+ emotion = {
129
+ 'angry': angry,
130
+ 'disgust': disgust,
131
+ 'fear': fear,
132
+ 'happy': happy,
133
+ 'sad': sad,
134
+ 'surprise': surprise,
135
+ 'neutral': neutral
136
+ },
137
 
138
+ # angry = 'total anger percentage' + str(angry)
139
+ # disgust = 'total disgust percentage' + str(disgust)
140
+ # fear = 'total fear percentage' + str(fear)
141
+ # happy = 'total happy percentage' + str(happy)
142
+ # sad = 'total sad percentage' + str(sad)
143
+ # surprise = 'total surprise percentage' + str(surprise)
144
+ # neutral = 'total neutral percentage' + str(neutral)
145
  print(f'total anger percentage = {angry}')
146
  print(f'total disgust percentage = {disgust}')
147
  print(f'total fear percentage = {fear}')
 
149
  print(f'total sad percentage = {sad}')
150
  print(f'total surprise percentage = {surprise}')
151
  print(f'total neutral percentage = {neutral}')
152
+ return str(gaze_percentage,emotion)
153
 
154
 
155
  demo = gr.Interface(fn=video_processing,