def draw_rects(img, rects):
"""
?????????????
:param img:
:param rects:
:return:
"""
for x, y, w, h in rects:
cv2.rectangle(img, (x, y), (x+w, y+h), (255, 255, 00), 2)
face = img
face = cv2.resize(face,(224,224))
if Gender.predict(face)==1:
text = "Male"
else:
text = "Female"
cv2.putText(img, text, (x, h), cv2.FONT_HERSHEY_SIMPLEX, 1.0, (255, 255, 255), lineType=cv2.LINE_AA)
评论列表
文章目录