CV之API:利用Face++的人体识别接口,实现摄像头实时手势识别
生活随笔
收集整理的這篇文章主要介紹了
CV之API:利用Face++的人体识别接口,实现摄像头实时手势识别
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
CV之API:利用Face++的人體識別接口,實現攝像頭實時手勢識別
?
?
?
?
目錄
測試圖片
實現代碼(部分)
?
?
?
?
?
測試圖片
?
實現代碼(部分)
#利用Face++的人體識別接口,實現攝像頭實時手勢識別 import requests from json import JSONDecoder import datetime import cv2 import oshttp_url ="https://api-cn.faceplusplus.com/humanbodypp/beta/gesture" key ="UVqp3_Es7_Gr504eGd0HQR4EWtvNC7u5" secret ="PB5hI_ytmOkRIYXxEQEIwmbH0bFdqrL6" filepath1 ="F:/Gesture5.jpg" data = {"api_key":key, "api_secret": secret, "return_gesture": "1"}files = {"image_file": open(filepath1, "rb")} cap = cv2.VideoCapture(0) while True:ret, frame = cap.read()# cv2.resize(frame,frame,320,240,0)# show a framecv2.imshow("capture", frame)cv2.imwrite(filepath1, frame)files = {"image_file": open(filepath1, "rb")}starttime = datetime.datetime.now()response = requests.post(http_url, data=data, files=files)endtime = datetime.datetime.now()print((endtime - starttime).seconds)req_con = response.content.decode('utf-8')req_dict = JSONDecoder().decode(req_con)print(req_dict)cv2.waitKey(10)?
總結
以上是生活随笔為你收集整理的CV之API:利用Face++的人体识别接口,实现摄像头实时手势识别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Py之smtplib:smtplib(a
- 下一篇: DL之PanopticFPN:Panop