你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

FaceOperations.FindSimilarWithHttpMessagesAsync 方法

定义

给定查询人脸的 faceId,用于在 faceId 数组、人脸列表或大型人脸列表中搜索类似的人脸。 faceId 数组包含人 脸 - 检测创建的人脸,这将在创建后 24 小时过期。 “faceListId”由 FaceList - 创建 包含不会过期的 persistedFaceIds 创建。 “largeFaceListId”由 LargeFaceList - 创建 ,其中包含也不会过期的 persistedFaceId。 根据输入,返回的相似人脸列表包含按相似性排名的 faceId 或 persistedFaceId。 <br/>Find similar 有两种工作模式:“matchPerson”和“matchFace”。 “matchPerson”是默认模式,它尝试通过使用内部同一人员阈值来查找同一个人的人脸。 查找已知人员的其他照片很有用。 请注意,如果没有人脸通过内部阈值,将返回空列表。 “matchFace”模式忽略同一人阈值,并返回排名相似的人脸,即使相似性较低。 它可用于搜索名人面孔等情况。 <br/>与查询人脸的 faceId 关联的“recognitionModel”应与目标 faceId 数组、人脸列表或大型人脸列表使用的“recognitionModel”相同。

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)))

参数

faceId
Guid

查询人脸的 FaceId。 用户需要先调用人脸 - 检测才能获取有效的 faceId。 请注意,此 faceId 不会持久保存,将在检测调用后 24 小时过期

faceListId
String

在人脸列表中创建的现有用户指定的唯一候选人脸列表

  • 创建人脸列表。 人脸列表包含一组持久化且永不过期的持久化FaceId。 不应同时提供参数 faceListId、largeFaceListId 和 faceIds。
largeFaceListId
String

现有的用户指定的唯一候选人脸大型列表,在 LargeFaceList - Create 中创建。 大型人脸列表包含一组持久化且永不过期的持久化FaceId。 不应同时提供参数 faceListId、largeFaceListId 和 faceIds。

faceIds
IList<Nullable<Guid>>

候选 faceIds 的数组。 所有这些都由人脸 - 检测创建,faceId 将在检测调用后 24 小时过期。 faceId 的数量限制为 1000。 不应同时提供参数 faceListId、largeFaceListId 和 faceIds。

maxNumOfCandidatesReturned
Nullable<Int32>

返回的最相似人脸的数量。 有效范围为 [1, 1000]。

mode
FindSimilarMatchMode

类似的人脸搜索模式。 它可以是“matchPerson”或“matchFace”。 可能的值包括:“matchPerson”、“matchFace”

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

实现

例外

当操作返回无效状态代码时引发

无法反序列化响应时引发

当所需参数为 null 时引发

当所需参数为 null 时引发

适用于