videoFind.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Gender 作者: rabeter 项目源码 文件源码
def draw_rects(img, rects, color):
    """
    ?????????????
    :param img: 
    :param rects: 
    :param color: 
    :return: 
    """
    for x, y, w, h in rects:
        face = img[x:x+w,y:y+h]
        face = cv2.resize(face,(224,224))
        if gender.predict(face)==1:
            text = "Male"
        else:
            text = "Female"
        cv2.rectangle(img, (x, y), (w, h), color, 2)
        cv2.putText(img, text, (x, h), cv2.FONT_HERSHEY_SIMPLEX, 2.0, (255, 255, 255), lineType=cv2.LINE_AA)
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号