def display(self, frame, face_locations):
"""
- Display results on screen with bboxes
:param frame: window frame
:return: window with resulting predictions on faces
"""
# Display the results
scale = 1
if self.resize:
scale = 4
if not len(face_locations) == 0: # nothing detected
for (top, right, bottom, left) in face_locations:
# Scale back up face locations since the frame we detected in was scaled to 1/4 size
top * scale
right * scale
bottom * scale
left * scale
# Draw a box around the face
cv2.rectangle(frame, (left, top), (right, bottom), (0, 255, 255), 2)
# else
评论列表
文章目录