first commit

This commit is contained in:
gocivici 2023-10-15 13:17:13 +03:00
commit ed45ec5de7
2 changed files with 17 additions and 0 deletions

17
main.py Normal file
View File

@ -0,0 +1,17 @@
import cv2
from deepface import DeepFace
# img = cv2.imread("test.jpg")
cam = cv2.VideoCapture(1)
if cam.isOpened():
while True:
ret, img = cam.read()
if ret:
predictions = DeepFace.analyze(img,enforce_detection=False,actions=['emotion'])
print(predictions[0]["emotion"]["fear"])
cv2.imshow('webcam',img)
key = cv2.waitKey(5) & 0xFF
if ord('q') == key:
break
cam.release()

BIN
test.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB