diff --git a/examples/facerec_from_webcam_faster.py b/examples/facerec_from_webcam_faster.py index e4a7bbd47..e0daa09c1 100644 --- a/examples/facerec_from_webcam_faster.py +++ b/examples/facerec_from_webcam_faster.py @@ -48,7 +48,7 @@ small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses) - rgb_small_frame = small_frame[:, :, ::-1] + rgb_small_frame = cv2.cvtColor(small_frame,cv2.COLOR_BGR2RGB) # Find all the faces and face encodings in the current frame of video face_locations = face_recognition.face_locations(rgb_small_frame) diff --git a/examples/identify_and_draw_boxes_on_faces.py b/examples/identify_and_draw_boxes_on_faces.py index 1b5fef7ae..20747f8fc 100644 --- a/examples/identify_and_draw_boxes_on_faces.py +++ b/examples/identify_and_draw_boxes_on_faces.py @@ -58,7 +58,8 @@ draw.rectangle(((left, top), (right, bottom)), outline=(0, 0, 255)) # Draw a label with a name below the face - text_width, text_height = draw.textsize(name) + text_width = draw.textlength(name) + text_height = draw.textlength(name) draw.rectangle(((left, bottom - text_height - 10), (right, bottom)), fill=(0, 0, 255), outline=(0, 0, 255)) draw.text((left + 6, bottom - text_height - 5), name, fill=(255, 255, 255, 255))