no face bug fix test
This commit is contained in:
parent
e3d2c201dc
commit
de7158b30b
10
main.py
10
main.py
@ -61,6 +61,7 @@ if cam.isOpened():
|
||||
img = cv2.flip(img, 0)
|
||||
img = cv2.rotate(img, cv2.ROTATE_90_COUNTERCLOCKWISE)
|
||||
# img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
|
||||
try:
|
||||
predictions = DeepFace.analyze(img,actions=['emotion'])
|
||||
fearValue = predictions[0]["emotion"]["fear"]
|
||||
surpriseValue = predictions[0]["emotion"]["surprise"]
|
||||
@ -98,15 +99,18 @@ if cam.isOpened():
|
||||
printer.set(align='center',font='b',width=2,height=2)
|
||||
|
||||
printer.image("cropScared.jpg",high_density_vertical=True,high_density_horizontal=False,impl="bitImageRaster")
|
||||
printer.text("Fear Level: \n" + str(round(fearValue,2))+"/100\n")
|
||||
printer.text("Surprise Level: \n" + str(round(surpriseValue,2))+"/100\n")
|
||||
printer.text("Overall: \n" + str(round(fearPoint,2))+"/100\n")
|
||||
printer.text("Fear Level: \n" + str(round(fearPoint,1))+"%\n")
|
||||
# printer.text("Surprise Level: \n" + str(round(surpriseValue,2))+"/100\n")
|
||||
# printer.text("Overall: \n" + str(round(fearPoint,2))+"/100\n")
|
||||
#printer.text("(Scream Queen)\n")
|
||||
printer.text("\n\n\n\n")
|
||||
#printer.set(align='center',font='b',width=1,height=1)
|
||||
#printer.text("Spooky Night 2023")
|
||||
#printer.text("2023\n")
|
||||
# cv2.waitKey(5000)
|
||||
except:
|
||||
cameraMode = False
|
||||
TIMER = 5
|
||||
|
||||
#print(30+math.floor(int(fearPoint)*580/100))
|
||||
# ft.putText(img=img,text='TEST',org=(15, 70),fontHeight=60,color=(255, 255, 255),thickness=-1,line_type=cv2.LINE_AA,bottomLeftOrigin=True)
|
||||
|
Loading…
Reference in New Issue
Block a user