实现compreface人脸识别接口
This commit is contained in:
parent
d7060b85ea
commit
28266be8a5
20
ruoyi-fastapi-backend/005测试compreface人脸识别服务.py
Normal file
20
ruoyi-fastapi-backend/005测试compreface人脸识别服务.py
Normal file
@ -0,0 +1,20 @@
|
||||
import requests
|
||||
|
||||
|
||||
|
||||
def face_recognition_stream(image_path, url):
|
||||
with open(image_path, 'rb') as f:
|
||||
response = requests.post(url, data=f.read())
|
||||
return response.json()
|
||||
|
||||
def face_recognition_file(image_path, url):
|
||||
|
||||
files = {"file": ("test.jpg", open(image_path, "rb"), "image/jpeg")}
|
||||
response = requests.post(url, files=files)
|
||||
return response.json()
|
||||
|
||||
if __name__ == '__main__':
|
||||
image_path = './haotian.jpg'
|
||||
url = 'http://10.0.0.202:9099/system/compreface/face_recognition'
|
||||
# print(face_recognition_stream(image_path, url))
|
||||
print(face_recognition_file(image_path, url))
|
||||
@ -39,6 +39,7 @@ from module_admin.controller.identification_record_controller import identificat
|
||||
from module_admin.controller.door_controller import doorController
|
||||
from module_admin.controller.haikang_controller import haikang_controller
|
||||
from module_admin.controller.sys_alert_controller import sys_alertController
|
||||
from module_admin.controller.compreface_controller import comprefaceController
|
||||
|
||||
from sub_applications.handle import handle_sub_applications
|
||||
from utils.common_util import worship
|
||||
@ -115,6 +116,7 @@ controller_list = [
|
||||
{'router': doorController, 'tags': ['门禁设备管理']},
|
||||
{'router': identification_statisticsController, 'tags': ['识别统计管理']},
|
||||
{'router': haikang_controller, 'tags': ['海康']},
|
||||
{'router': comprefaceController, 'tags': ['人脸识别管理']},
|
||||
# {'router': sys_alertController, 'tags': ['系统告警消息']}
|
||||
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user