rotation fix
This commit is contained in:
parent
f715138204
commit
28961839d6
8
main.py
8
main.py
@ -24,7 +24,7 @@ startScreen = cv2.imread("noFace.png")
|
||||
if cam.isOpened():
|
||||
while True:
|
||||
ret, img = cam.read()
|
||||
img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
|
||||
# img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
|
||||
if cameraMode and ret:
|
||||
prev = time.time()
|
||||
while TIMER > 0:
|
||||
@ -50,13 +50,13 @@ if cam.isOpened():
|
||||
break
|
||||
else:
|
||||
ret, img = cam.read()
|
||||
img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
|
||||
# img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
|
||||
predictions = DeepFace.analyze(img,actions=['emotion'])
|
||||
fearPoint = predictions[0]["emotion"]["fear"]
|
||||
print("FEAR:" + str(round(fearPoint,2)))
|
||||
if fearPoint>0:
|
||||
|
||||
cv2.imwrite('scared.jpg', img)
|
||||
rotoImg = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
|
||||
cv2.imwrite('scared.jpg', rotoImg)
|
||||
basewidth = 384
|
||||
imgCrop = Image.open('scared.jpg')
|
||||
wpercent = (basewidth/float(imgCrop.size[0]))
|
||||
|
Loading…
Reference in New Issue
Block a user