Compartilhar via


FaceClient.VerifyFaceToFace Method

Definition

Overloads

VerifyFaceToFace(RequestContent, RequestContext)

[Protocol Method] Verify whether two faces belong to a same person.

VerifyFaceToFace(Guid, Guid, CancellationToken)

Verify whether two faces belong to a same person.

VerifyFaceToFace(RequestContent, RequestContext)

Source:
FaceClient.cs

[Protocol Method] Verify whether two faces belong to a same person.

public virtual Azure.Response VerifyFaceToFace (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member VerifyFaceToFace : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.VerifyFaceToFace : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function VerifyFaceToFace (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 VerifyFaceToFace 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
{
    faceId1 = "c5c24a82-6845-4031-9d5d-978df9175426",
    faceId2 = "3aa87e30-b380-48eb-ad9e-1aa54fc52bd3",
});
Response response = client.VerifyFaceToFace(content);

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

Applies to

VerifyFaceToFace(Guid, Guid, CancellationToken)

Source:
FaceClient.cs

Verify whether two faces belong to a same person.

public virtual Azure.Response<Azure.AI.Vision.Face.FaceVerificationResult> VerifyFaceToFace (Guid faceId1, Guid faceId2, System.Threading.CancellationToken cancellationToken = default);
abstract member VerifyFaceToFace : Guid * Guid * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Vision.Face.FaceVerificationResult>
override this.VerifyFaceToFace : Guid * Guid * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Vision.Face.FaceVerificationResult>
Public Overridable Function VerifyFaceToFace (faceId1 As Guid, faceId2 As Guid, Optional cancellationToken As CancellationToken = Nothing) As Response(Of FaceVerificationResult)

Parameters

faceId1
Guid

The faceId of one face, come from "Detect".

faceId2
Guid

The faceId of another face, come from "Detect".

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call VerifyFaceToFace.

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

Response<FaceVerificationResult> response = client.VerifyFaceToFace(Guid.Parse("c5c24a82-6845-4031-9d5d-978df9175426"), Guid.Parse("3aa87e30-b380-48eb-ad9e-1aa54fc52bd3"));

Remarks

Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for more details.

Applies to