Partager via


FaceClient.IdentifyFromLargePersonGroup Method

Definition

Overloads

IdentifyFromLargePersonGroup(RequestContent, RequestContext)

[Protocol Method] 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group.

IdentifyFromLargePersonGroup(IEnumerable<Guid>, String, Nullable<Int32>, Nullable<Single>, CancellationToken)

1-to-many identification to find the closest matches of the specific query person face from a Large Person Group.

IdentifyFromLargePersonGroup(RequestContent, RequestContext)

Source:
FaceClient.cs

[Protocol Method] 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group.

public virtual Azure.Response IdentifyFromLargePersonGroup (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member IdentifyFromLargePersonGroup : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.IdentifyFromLargePersonGroup : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function IdentifyFromLargePersonGroup (content As RequestContent, Optional context As RequestContext = Nothing) As Response

Parameters

content
RequestContent

The content to send as the body of the request.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

content is null.

Service returned a non-success status code.

Examples

This sample shows how to call IdentifyFromLargePersonGroup and parse the result.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceClient client = new FaceClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    faceIds = new object[]
    {
        "c5c24a82-6845-4031-9d5d-978df9175426"
    },
    largePersonGroupId = "your_large_person_group_id",
    maxNumOfCandidatesReturned = 9,
    confidenceThreshold = 0.7F,
});
Response response = client.IdentifyFromLargePersonGroup(content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].GetProperty("faceId").ToString());
Console.WriteLine(result[0].GetProperty("candidates")[0].GetProperty("personId").ToString());
Console.WriteLine(result[0].GetProperty("candidates")[0].GetProperty("confidence").ToString());

Applies to

IdentifyFromLargePersonGroup(IEnumerable<Guid>, String, Nullable<Int32>, Nullable<Single>, CancellationToken)

Source:
FaceClient.cs

1-to-many identification to find the closest matches of the specific query person face from a Large Person Group.

public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.FaceIdentificationResult>> IdentifyFromLargePersonGroup (System.Collections.Generic.IEnumerable<Guid> faceIds, string largePersonGroupId, int? maxNumOfCandidatesReturned = default, float? confidenceThreshold = default, System.Threading.CancellationToken cancellationToken = default);
abstract member IdentifyFromLargePersonGroup : seq<Guid> * string * Nullable<int> * Nullable<single> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.FaceIdentificationResult>>
override this.IdentifyFromLargePersonGroup : seq<Guid> * string * Nullable<int> * Nullable<single> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.FaceIdentificationResult>>
Public Overridable Function IdentifyFromLargePersonGroup (faceIds As IEnumerable(Of Guid), largePersonGroupId As String, Optional maxNumOfCandidatesReturned As Nullable(Of Integer) = Nothing, Optional confidenceThreshold As Nullable(Of Single) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of IReadOnlyList(Of FaceIdentificationResult))

Parameters

faceIds
IEnumerable<Guid>

Array of query faces faceIds, created by the "Detect". Each of the faces are identified independently. The valid number of faceIds is between [1, 10].

largePersonGroupId
String

largePersonGroupId of the target Large Person Group, created by "Create Large Person Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time.

maxNumOfCandidatesReturned
Nullable<Int32>

The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is 10.

confidenceThreshold
Nullable<Single>

Customized identification confidence threshold, in the range of [0, 1]. Advanced user can tweak this value to override default internal threshold for better precision on their scenario data. Note there is no guarantee of this threshold value working on other data and after algorithm updates.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

faceIds or largePersonGroupId is null.

Examples

This sample shows how to call IdentifyFromLargePersonGroup.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceClient client = new FaceClient(endpoint, credential);

Response<IReadOnlyList<FaceIdentificationResult>> response = client.IdentifyFromLargePersonGroup(new Guid[] { Guid.Parse("c5c24a82-6845-4031-9d5d-978df9175426") }, "your_large_person_group_id");

Remarks

Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group for more details.

Applies to