Share via


FaceClient.IdentifyFromLargePersonGroupAsync Method

Definition

Overloads

IdentifyFromLargePersonGroupAsync(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.

IdentifyFromLargePersonGroupAsync(RequestContent, RequestContext)

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

IdentifyFromLargePersonGroupAsync(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 System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.FaceIdentificationResult>>> IdentifyFromLargePersonGroupAsync (System.Collections.Generic.IEnumerable<Guid> faceIds, string largePersonGroupId, int? maxNumOfCandidatesReturned = default, float? confidenceThreshold = default, System.Threading.CancellationToken cancellationToken = default);
abstract member IdentifyFromLargePersonGroupAsync : seq<Guid> * string * Nullable<int> * Nullable<single> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.FaceIdentificationResult>>>
override this.IdentifyFromLargePersonGroupAsync : seq<Guid> * string * Nullable<int> * Nullable<single> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.FaceIdentificationResult>>>
Public Overridable Function IdentifyFromLargePersonGroupAsync (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 Task(Of 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 IdentifyFromLargePersonGroupAsync.

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

Response<IReadOnlyList<FaceIdentificationResult>> response = await client.IdentifyFromLargePersonGroupAsync(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

IdentifyFromLargePersonGroupAsync(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 System.Threading.Tasks.Task<Azure.Response> IdentifyFromLargePersonGroupAsync (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member IdentifyFromLargePersonGroupAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.IdentifyFromLargePersonGroupAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function IdentifyFromLargePersonGroupAsync (content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of 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 IdentifyFromLargePersonGroupAsync 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 = await client.IdentifyFromLargePersonGroupAsync(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