国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術(shù)文章
文章詳情頁

python 使用百度AI接口進行人臉對比的步驟

瀏覽:52日期:2022-06-24 15:33:58
1. 注冊百度云賬號

注冊百度智能云,提交申請。

創(chuàng)建應(yīng)用獲取AppID,API Key,Secret Key。

2. 安裝baidu python api

人臉對比 API 文檔

pip install baidu-aip

調(diào)用:

import base64from aip import AipFaceAPP_ID = ’你的 App ID’API_KEY = ’你的 Api Key’SECRET_KEY = ’你的 Secret Key’client = AipFace(APP_ID, API_KEY, SECRET_KEY)result = client.match([ { ’image’: str(base64.b64encode(open(’D:/chenjy/1.png’, ’rb’).read()), ’utf-8’), ’image_type’: ’BASE64’, }, { ’image’: str(base64.b64encode(open(’D:/chenjy/2.png’, ’rb’).read()), ’utf-8’), ’image_type’: ’BASE64’, } ])print(result)

返回值:

python 使用百度AI接口進行人臉對比的步驟

返回主要參數(shù)說明:

參數(shù)名 必選 類型 說明 score 是 float 人臉相似度得分,推薦閾值80分 face_list 是 array 人臉信息列表 face_token 是 string 人臉的唯一標志 3.調(diào)用攝像頭

import cv2cap = cv2.VideoCapture(0) # 打開攝像頭while True: ret, frame = cap.read() frame = cv2.flip(frame, 1) cv2.imshow(’window’, frame) cv2.imwrite(’D:/chenjy/2.png’, frame) # 保存路徑 cv2.waitKey(2000)cap.release()cv2.destroyAllWindows()4.完整測試程序

import cv2import base64from aip import AipFaceAPP_ID = ’你的 App ID’API_KEY = ’你的 Api Key’SECRET_KEY = ’你的 Secret Key’client = AipFace(APP_ID, API_KEY, SECRET_KEY)def get_result(): result = client.match([ { ’image’: str(base64.b64encode(open(’D:/chenjy/1.png’, ’rb’).read()), ’utf-8’), ’image_type’: ’BASE64’, }, { ’image’: str(base64.b64encode(open(’D:/chenjy/2.png’, ’rb’).read()), ’utf-8’), ’image_type’: ’BASE64’, } ]) if result[’error_msg’] == ’SUCCESS’: score = result[’result’][’score’] print(result) print(’相似度:’+str(score)) else: print(’服務(wù)器錯誤’)cap = cv2.VideoCapture(0) # 打開攝像頭while True: ret, frame = cap.read() frame = cv2.flip(frame, 1) cv2.imshow(’window’, frame) cv2.imwrite(’D:/chenjy/2.png’, frame) # 保存路徑 cv2.waitKey(2000) get_result()cap.release()cv2.destroyAllWindows()

結(jié)果:

照片加了模糊處理

python 使用百度AI接口進行人臉對比的步驟

python 使用百度AI接口進行人臉對比的步驟

以上就是python 使用百度AI接口進行人臉對比的步驟的詳細內(nèi)容,更多關(guān)于python 人臉對比的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標簽: 百度 Python
相關(guān)文章:
主站蜘蛛池模板: 日本免费一区二区三区三州 | 男女视频免费网站 | 久久视频这里只精品3国产 久久视频这里只有精品 | 精品一区二区三区的国产在线观看 | 亚洲国产精品自在现线让你爽 | 久久99国产精品免费观看 | 大视频在线爱爱爱爱 | 亚洲国产日韩女人aaaaaa毛片在线 | 福利姬在线精品观看 | 国产系列在线播放 | 美女亚洲综合 | 色综合色狠狠天天久久婷婷基地 | 久久亚洲欧洲日产国码 | www亚洲一区 | 免费狼人久久香蕉网 | 美女被躁爽死 | 亚洲欧美成人影院 | 国语自产拍天天在线 | 窝窝女人体国产午夜视频 | 中文字幕在线视频精品 | 国产成人亚洲综合网站不卡 | 日本免费网址 | 性做久久久久久久免费看 | 日本aa毛片a级毛片免费观看 | 在线黄网| 久久精品全国免费观看国产 | 亚洲国产精品大秀在线播放 | 久草网站在线观看 | 国产成人女人在线视频观看 | 久久精品视频观看 | 亚洲99久久久久综合 | 成人欧美精品一区二区不卡 | 中文字幕乱码中文乱码51精品 | 成年人网站黄 | 国产小网站 | 国产一级小视频 | 亚洲三级免费观看 | 亚洲高清一区二区三区 | 国产乱色在线观看 | 久久爱噜噜噜噜久久久网 | 伊人狠狠丁香婷婷综合色 |