We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08f72d7 commit 9605adeCopy full SHA for 9605ade
moumoubaimifan/face_contrast/face_contrast.py
@@ -0,0 +1,23 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+import face_recognition
4
+import cv2
5
+import os
6
+import time
7
8
+pic_boss = face_recognition.load_image_file("/Users/xx/Desktop/face/0.png")
9
+boss_face_encoding = face_recognition.face_encodings(pic_boss)[0]
10
11
+cap = cv2.VideoCapture(0)
12
+while True:
13
+ ret, frame = cap.read()
14
15
+ face_locations = face_recognition.face_locations(frame)
16
+ face_encodings = face_recognition.face_encodings(frame, face_locations)
17
18
+ for face_encoding in face_encodings:
19
+ results = face_recognition.compare_faces([boss_face_encoding], face_encoding)
20
+ if results[0]:
21
+ print("boss来了,快打开其他应用")
22
+ os.system('open /Applications/PyCharm.app')
23
+ time.sleep(300)
0 commit comments