cognitive-services系列 -- 使用微软cognitive-services中的人脸识别模块

来源:互联网 发布:淘宝有多少家天猫店 编辑:程序博客网 时间:2024/05/22 02:29

1.注册Cognitive Services账号,获取一个APIkey。





2.打开在线调试console
https://dev.projectxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236/console


api地址:
https://api.projectoxford.ai/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false




请求:
POST https://api.projectoxford.ai/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false HTTP/1.1Content-Type: application/jsonHost: api.projectoxford.aiOcp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••{    "url":"https://news.usc.edu/files/2016/03/Sample_Steven-1-824x549.jpg"}





返回:
Pragma: no-cacheapim-request-id: 292aa39c-4ffd-41bd-87fe-b947af1ae71dStrict-Transport-Security: max-age=31536000; includeSubDomains; preloadCache-Control: no-cacheDate: Sun, 15 Jan 2017 10:38:34 GMTX-AspNet-Version: 4.0.30319X-Powered-By: ASP.NETContent-Length: 115Content-Type: application/json; charset=utf-8Expires: -1[  {    "faceId": "99cfe413-6410-4305-a460-8b50c748d35f",    "faceRectangle": {      "top": 149,      "left": 298,      "width": 228,      "height": 228    }  }]








返回值默认只包含人脸的矩形坐标以及长宽。可以添加更多参数。





4. copy faceid (用于其他相关API)







人脸识别模块中的其他相关 api:
创建Person
删除Person
创建Group
添加Person到Group
获取Group
获取Group列表
创建FaceList
删除FaceList
获取FaceList的列表
创建Face
添加Face到FaceList
找到相似的Face
验证Face(参数:FaceId,PersonId,personGroupId)


可以说是一个完整的module,并且所有服务是Cloud based,扩展性和HA都是有保障的,API也都是restful的。
2 0