@@ -37,8 +37,8 @@ def classify_face(im):
37
37
cam .saveSnapshot ('~/faces/image.jpg' )
38
38
time .sleep (5 )
39
39
img = cv2 .imread (im , 1 )
40
- #img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5)
41
- #img = img[:,:,::-1]
40
+ # img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5)
41
+ # img = img[:,:,::-1]
42
42
43
43
face_locations = fr .face_locations (img )
44
44
unknown_face_encodings = fr .face_encodings (img , face_locations )
@@ -59,12 +59,12 @@ def classify_face(im):
59
59
60
60
for (top , right , bottom , left ), name in zip (face_locations , face_names ):
61
61
# Draw a box around the face
62
- cv2 .rectangle (img , (left - 20 , top - 20 ),
63
- (right + 20 , bottom + 20 ), (255 , 0 , 0 ), 2 )
62
+ cv2 .rectangle (img , (left - 20 , top - 20 ),
63
+ (right + 20 , bottom + 20 ), (255 , 0 , 0 ), 2 )
64
64
65
65
# Draw a label with a name below the face
66
- cv2 .rectangle (img , (left - 20 , bottom - 15 ),
67
- (right + 20 , bottom + 20 ), (255 , 0 , 0 ), cv2 .FILLED )
66
+ cv2 .rectangle (img , (left - 20 , bottom - 15 ),
67
+ (right + 20 , bottom + 20 ), (255 , 0 , 0 ), cv2 .FILLED )
68
68
font = cv2 .FONT_HERSHEY_DUPLEX
69
69
cv2 .putText (img , name , (left - 20 , bottom + 15 ),
70
70
font , 1.0 , (255 , 255 , 255 ), 2 )
0 commit comments