commit ed45ec5de7179b6587ad0fd0d43c0d2130b2e15f Author: gocivici Date: Sun Oct 15 13:17:13 2023 +0300 first commit diff --git a/main.py b/main.py new file mode 100644 index 0000000..9cbebc1 --- /dev/null +++ b/main.py @@ -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() \ No newline at end of file diff --git a/test.jpg b/test.jpg new file mode 100644 index 0000000..b08f943 Binary files /dev/null and b/test.jpg differ