Commit 0805d72e authored by NaweenTharuka's avatar NaweenTharuka

Updated video emotion detection backend

parent d5bf965f
...@@ -124,6 +124,7 @@ def detect_emotions(location_videofile, NumberofFrames): ...@@ -124,6 +124,7 @@ def detect_emotions(location_videofile, NumberofFrames):
try: try:
gray_face = cv2.resize(gray_face, model.input_shape[1:3]) gray_face = cv2.resize(gray_face, model.input_shape[1:3])
except Exception as e: except Exception as e:
print("Cannot resize "+str(e))
continue continue
gray_face = __preprocess_input(gray_face, True) gray_face = __preprocess_input(gray_face, True)
...@@ -154,4 +155,4 @@ def detect_emotions(location_videofile, NumberofFrames): ...@@ -154,4 +155,4 @@ def detect_emotions(location_videofile, NumberofFrames):
else: else:
return max(arry, key=arry.get), arry return max(arry, key=arry.get), arry
emo, arr1 = detect_emotions(location_videofile, 300) emo, arr1 = detect_emotions(location_videofile, 50)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment