FaceOperations.FindSimilarWithHttpMessagesAsync Method

Definition

Given query face's faceId, to search the similar-looking faces from a faceId array, a face list or a large face list. faceId array contains the faces created by Face - Detect, which will expire 24 hours after creation. A "faceListId" is created by FaceList - Create containing persistedFaceIds that will not expire. And a "largeFaceListId" is created by LargeFaceList - Create containing persistedFaceIds that will also not expire. Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. <br/>Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is low. It can be used in the cases like searching celebrity-looking faces. <br/>The 'recognitionModel' associated with the query face's faceId should be the same as the 'recognitionModel' used by the target faceId array, face list or large face list.

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.SimilarFace>>> FindSimilarWithHttpMessagesAsync (Guid faceId, string faceListId = default, string largeFaceListId = default, System.Collections.Generic.IList<Guid?> faceIds = default, int? maxNumOfCandidatesReturned = 20, Microsoft.Azure.CognitiveServices.Vision.Face.Models.FindSimilarMatchMode mode = Microsoft.Azure.CognitiveServices.Vision.Face.Models.FindSimilarMatchMode.MatchPerson, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member FindSimilarWithHttpMessagesAsync : Guid * string * string * System.Collections.Generic.IList<Nullable<Guid>> * Nullable<int> * Microsoft.Azure.CognitiveServices.Vision.Face.Models.FindSimilarMatchMode * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.SimilarFace>>>
override this.FindSimilarWithHttpMessagesAsync : Guid * string * string * System.Collections.Generic.IList<Nullable<Guid>> * Nullable<int> * Microsoft.Azure.CognitiveServices.Vision.Face.Models.FindSimilarMatchMode * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.SimilarFace>>>
Public Function FindSimilarWithHttpMessagesAsync (faceId As Guid, Optional faceListId As String = Nothing, Optional largeFaceListId As String = Nothing, Optional faceIds As IList(Of Nullable(Of Guid)) = Nothing, Optional maxNumOfCandidatesReturned As Nullable(Of Integer) = 20, Optional mode As FindSimilarMatchMode = Microsoft.Azure.CognitiveServices.Vision.Face.Models.FindSimilarMatchMode.MatchPerson, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of IList(Of SimilarFace)))

Parameters

faceId
Guid

FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call

faceListId
String

An existing user-specified unique candidate face list, created in Face List

  • Create a Face List. Face list contains a set of persistedFaceIds which are persisted and will never expire. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time.
largeFaceListId
String

An existing user-specified unique candidate large face list, created in LargeFaceList - Create. Large face list contains a set of persistedFaceIds which are persisted and will never expire. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time.

faceIds
IList<Nullable<Guid>>

An array of candidate faceIds. All of them are created by Face - Detect and the faceIds will expire 24 hours after the detection call. The number of faceIds is limited to 1000. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time.

maxNumOfCandidatesReturned
Nullable<Int32>

The number of top similar faces returned. The valid range is [1, 1000].

mode
FindSimilarMatchMode

Similar face searching mode. It can be "matchPerson" or "matchFace". Possible values include: 'matchPerson', 'matchFace'

customHeaders
Dictionary<String,List<String>>

Headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Implements

Exceptions

Thrown when the operation returned an invalid status code

Thrown when unable to deserialize the response

Thrown when a required parameter is null

Thrown when a required parameter is null

Applies to