face_detect_cv3.py 文件源码

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

项目:facejack 作者: PetarV- 项目源码 文件源码
def dispact_and_update(img, hack, base_im, x, y, w, h):
    try:
        myurl = "http://facejack.westeurope.cloudapp.azure.com:5001/imsend"
        headers = {
            'content-type': "application/x-www-form-urlencoded",
            'cache-control': "no-cache"
        }
        r = requests.post(url=myurl, data=img, headers=headers, params={'hack': str(hack)}).json()

        reply = 'authentication' in r and r['authentication'] == "ALLOWED"
        disp_face = cv2.resize(base_im[y:y + h, x:x + w], (224, 224), 0, 0, cv2.INTER_LANCZOS4)
        if reply:
            cv2.rectangle(disp_face, (0, 0), (222, 222), (0, 255, 0), 2)
        else:
            cv2.rectangle(disp_face, (0, 0), (222, 222), (0, 0, 255), 2)
        cv2.imshow("Face", disp_face)
    finally:
        myl.release()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号