Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def emotionAnalysis(message, face):
|
|
62 |
img_rgb = cv2.cvtColor(face, cv2.COLOR_BGR2RGB)
|
63 |
result = face_emotion_detector.top_emotion(img_rgb)
|
64 |
print(result)
|
65 |
-
if result is not None: # Only update if we got a valid result
|
66 |
face_emotion, face_score = result
|
67 |
else:
|
68 |
face_emotion = "No face detected"
|
|
|
62 |
img_rgb = cv2.cvtColor(face, cv2.COLOR_BGR2RGB)
|
63 |
result = face_emotion_detector.top_emotion(img_rgb)
|
64 |
print(result)
|
65 |
+
if result[0] is not None: # Only update if we got a valid result
|
66 |
face_emotion, face_score = result
|
67 |
else:
|
68 |
face_emotion = "No face detected"
|