Azure Face API中人员组的一致性 [英] Consistency of person groups in Azure Face API

查看:65
本文介绍了Azure Face API中人员组的一致性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

最近我一直在使用Face API。最初我使用他们提供的api在face api中创建了一个人组。之后我开始了解Python SDK,所以我试了一下示例python应用程序。令我惊讶的是,我之前创建的
人群并不存在,我不得不创建一个新组。所以这是我的问题。即使我使用API​​调用来运行服务或使用SDK for android或python,我如何在任何地方获得相同的人员组?当您执行API调用时,不会看到使用SDK创建
的人员组,反之亦然。注意我在两个地方都使用相同的端点和相同的订阅密钥。

Recently I'm been using Face API recently. Initially I created a person group in the face api using the apis they provided. Afterwards I came to know about the Python SDK, so I gave it a short by trying out the sample python application. To my surprise the person group I created earlier wasn't there and I had to create a new one. So this is my question. How do I get the same person group everywhere, even if I use the API calls to run the service or use the SDKs for android or python? The person group created using the SDKs are not seen when you do an API call and vice-versa. Note I'm using the same endpoint and the same subscription key at both places.

推荐答案

Hello rjmendus,

Hello rjmendus,

值得注意的是,如果它们是使用相同的键和端点从API或python SDK创建的,那么并非所有的面组都不可见。我试图通过使用postman和python SDK中的API来复制您的场景。我使用postman的API创建
组,并从python SDK中检索组。以下是我遵循的步骤:

It is interesting to note that not all your face groups are not visible if they are created from API or python SDK when they are using the same keys and endpoint. I have tried to replicate your scenario by using the API from postman and python SDK. I created the group using the API from postman and retrieved the groups from python SDK. Here are the steps I followed:

邮差客户

创建了两个组

GroupID:abc,GroupName:abc

GroupID: abc, GroupName: abc

GroupID:newgroup,GroupName:mygroup

GroupID: newgroup, GroupName: mygroup

创建了一个,我检查了是否可以从邮递员处获得相同内容。

One they are created, I checked if i could get the same from postman.

使用Python SDK检索相同的组

代码:

import os 
from azure.cognitiveservices.vision.face import FaceClient
from azure.cognitiveservices.vision.face.operations import PersonGroupOperations
from msrest.authentication import CognitiveServicesCredentials

FACE_LOCATION = os.environ.get("FACE_LOCATION", "<YOUR_LOCATION>")

face_base_url = "https://{}.api.cognitive.microsoft.com".format(FACE_LOCATION)
subscription_key='<your_subscription_key>'
face_client = FaceClient(endpoint=face_base_url, credentials=CognitiveServicesCredentials(subscription_key))

group1=face_client.person_group.get(person_group_id='abc')
group2=face_client.person_group.get(person_group_id='newgroup')

print(group1.name)
print(group2.name)

运行此代码的结果:

根据这些结果,我能够检索所有组。你可以重新检查它是否适合你使用它? azure-cognitiveservices-vision-face   I
使用的版本是0.2.0

Based on these results I was able to retrieve all the groups. Could you please re-check if it works for you using the same? The version of azure-cognitiveservices-vision-face I used is 0.2.0

这里有一些
样本


这篇关于Azure Face API中人员组的一致性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆