From b12002bdb41e10af167dda4aaad4e5bc11b402af Mon Sep 17 00:00:00 2001 From: gocivici Date: Thu, 19 Oct 2023 16:41:11 +0300 Subject: [PATCH] bug fix --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 0a167ce..8b024b8 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ from PIL import ImageFont from deepface import DeepFace #pip install deepface -cam = cv2.VideoCapture(1) +cam = cv2.VideoCapture(0) printer = Serial(devfile='/dev/serial0',baudrate=19200,bytesize=8,parity='N',stopbits=1.00,dsrdtr=True) printer.set(density=10) @@ -56,7 +56,7 @@ if cam.isOpened(): imgCrop = Image.open('scared.jpg') wpercent = (basewidth/float(imgCrop.size[0])) hsize = int((float(imgCrop.size[1])*float(wpercent))) - imgCrop = imgCrop.resize((basewidth,hsize), Image.ANTIALIAS) + imgCrop = imgCrop.resize((basewidth,hsize), Image.Resampling.LANCZOS) imgCrop = imgCrop.save("cropScared.jpg") printer.image(imgCrop) printer.text("\n\n\n\n")