Condividi tramite


LargeFaceListClient.GetFaceAsync Method

Definition

Overloads

GetFaceAsync(Guid, CancellationToken)

Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more details.

GetFaceAsync(Guid, RequestContext)

[Protocol Method] Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more details.

GetFaceAsync(Guid, CancellationToken)

Source:
LargeFaceListClient.cs
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.LargeFaceListFace>> GetFaceAsync (Guid persistedFaceId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetFaceAsync : Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.LargeFaceListFace>>
override this.GetFaceAsync : Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.LargeFaceListFace>>
Public Overridable Function GetFaceAsync (persistedFaceId As Guid, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of LargeFaceListFace))

Parameters

persistedFaceId
Guid

Face ID of the face.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetFaceAsync.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
LargeFaceListClient client = new FaceAdministrationClient(endpoint, credential).GetLargeFaceListClient("your_large_face_list_id");

Response<LargeFaceListFace> response = await client.GetFaceAsync(Guid.Parse("43897a75-8d6f-42cf-885e-74832febb055"));

Applies to

GetFaceAsync(Guid, RequestContext)

Source:
LargeFaceListClient.cs

[Protocol Method] Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more details.

public virtual System.Threading.Tasks.Task<Azure.Response> GetFaceAsync (Guid persistedFaceId, Azure.RequestContext context);
abstract member GetFaceAsync : Guid * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetFaceAsync : Guid * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetFaceAsync (persistedFaceId As Guid, context As RequestContext) As Task(Of Response)

Parameters

persistedFaceId
Guid

Face ID of the face.

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

Service returned a non-success status code.

Examples

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

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
LargeFaceListClient client = new FaceAdministrationClient(endpoint, credential).GetLargeFaceListClient("your_large_face_list_id");

Response response = await client.GetFaceAsync(Guid.Parse("43897a75-8d6f-42cf-885e-74832febb055"), null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("persistedFaceId").ToString());

Applies to