文档包含为人添加一张脸的代码, 但如何识别人脸?显示向一个人添加多个图像的选项.. 向一个人添加一张脸的以下代码是:
import httplib, urllib, base64
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.urlencode({
# Request parameters
'userData': '{string}',
'targetFace': '{string}',
})
try:
conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com')
conn.request("POST", "/face/v1.0/persongroups/{personGroupId}/persons/{personId}/persistedFaces?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
如果可以为一个人添加多个面孔,那么您能否让我知道文档如何或在何处谈论它?