" \-d '{"subject": " 赞 踩 创建主题 重命名主题 删除一个主题 删除所有主题 主题列表 给主题添加一个图片 图片文件方式: base64图片方式: 主题图片列表 删除主题所有图片 删除指定图片 通过ID直接下载主题图片 通过ID下载主题图片 识别指定照片 图片文件方式: base64方式: 与指定图片比较 图片比较 图片文件方式: base64方式: Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。
使用ComperFace实现人脸识别_compreface如何使用
安装部署
创建应用
API说明
主题
正常情况下不需要调用该接口,直接调用上传照片接口,并指定主题名称即可
curl -X POST "http://localhost:8000/api/v1/recognition/subjects" \
-H "Content-Type: application/json" \
-H "x-api-key: <service_api_key>" \
-d '{"subject": "<subject_name>"}'
略,参考官方文档
略,参考官方文档
略,参考官方文档
略,参考官方文档
无需创建主题 直接指定主题名称,并上传图片即可.
主题名称参数需要在url后指定
curl -X POST "http://localhost:8000/api/v1/recognition/faces?subject=<subject>&det_prob_threshold=<det_prob_threshold>" \
-H "Content-Type: multipart/form-data" \
-H "x-api-key: <service_api_key>" \
-F file=@<local_file>
curl -X POST "http://localhost:8000/api/v1/recognition/faces?subject=<subject>&det_prob_threshold=<det_prob_threshold>" \
-H "Content-Type: application/json" \
-H "x-api-key: <service_api_key>" \
-d {"file": "<base64_value>"}
6.0版本不支持按照主题查询,1.0后续版本才支持, 感觉6.0版本该接口用处不大
curl -X GET "http://localhost:8000/api/v1/recognition/faces?page=<page>&size=<size>&subject=<subject>" \
-H "x-api-key: <service_api_key>" \
由于6.0版本不支持按照主题查询人脸列表, 添加新人脸时可能需要先删除该主题所有人脸
curl -X DELETE "http://localhost:8000/api/v1/recognition/faces?subject=<subject>" \
-H "x-api-key: <service_api_key>"
略
接口返回图片二进制文件, 也将该地址直接嵌入到html标签中(是否安全)
curl -X GET "http://localhost:8000/api/v1/static/<service_api_key>/images/<image_id>"
接口返回图片二进制文件
curl -X GET "http://localhost:8000/api/v1/recognition/faces/<image_id>/img"
-H "x-api-key: <service_api_key>"
识别上传照片, 返回匹配到的主题
curl -X POST "http://localhost:8000/api/v1/recognition/recognize?limit=<limit>&prediction_count=<prediction_count>&det_prob_threshold=<det_prob_threshold>&face_plugins=<face_plugins>&status=<status>" \
-H "Content-Type: multipart/form-data" \
-H "x-api-key: <service_api_key>" \
-F file=<local_file>
curl -X POST "http://localhost:8000/api/v1/recognition/recognize?limit=<limit>&prediction_count=<prediction_count>&det_prob_threshold=<det_prob_threshold>&face_plugins=<face_plugins>&status=<status>" \
-H "Content-Type: application/json" \
-H "x-api-key: <service_api_key>" \
-d {"file": "<base64_value>"}
上传一张照片 与指定的主题照片进行比对
略
通过上传两张照片 , 比较两个人脸照片的相似度
该接口service类型需要为Verification
curl -X POST "http://localhost:8000/api/v1/verification/verify?limit=<limit>&prediction_count=<prediction_count>&det_prob_threshold=<det_prob_threshold>&face_plugins=<face_plugins>&status=<status>" \
-H "Content-Type: multipart/form-data" \
-H "x-api-key: <service_api_key>" \
-F source_image=<local_check_file>
-F target_image=<local_process_file>
curl -X POST "http://localhost:8000/api/v1/verification/verify?limit=<limit>&prediction_count=<prediction_count>&det_prob_threshold=<det_prob_threshold>&face_plugins=<face_plugins>&status=<status>" \
-H "Content-Type: application/json" \
-H "x-api-key: <service_api_key>" \
-d {"source_image": "<source_image_base64_value>", "target_image": "<target_image_base64_value>"}