From 962db75d6b98adb9d4a5fc8723969124f50e87ee Mon Sep 17 00:00:00 2001 From: gocivici Date: Thu, 26 Oct 2023 21:10:54 +0300 Subject: [PATCH] gray image --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 9d1f9d0..ad4e448 100644 --- a/main.py +++ b/main.py @@ -61,7 +61,8 @@ if cam.isOpened(): predictions = DeepFace.analyze(img,actions=['emotion']) fearPoint = predictions[0]["emotion"]["fear"] print("FEAR:" + str(round(fearPoint,2))) - cv2.imwrite('scared.jpg', img) + imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) + cv2.imwrite('scared.jpg', imgGray) img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB) img = Image.fromarray(img) draw = ImageDraw.Draw(img)