第一次提交:阿龙电竞 Django 后端最新版本
This commit is contained in:
@@ -0,0 +1,291 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# 认证失败。
|
||||
AUTHFAILURE_INVALIDAUTHORIZATION = 'AuthFailure.InvalidAuthorization'
|
||||
|
||||
# 操作失败。
|
||||
FAILEDOPERATION = 'FailedOperation'
|
||||
|
||||
# 该操作不支持跨算法模型版本。
|
||||
FAILEDOPERATION_ACROSSVERSIONSERROR = 'FailedOperation.AcrossVersionsError'
|
||||
|
||||
# 操作冲突,请勿同时操作相同的Person。
|
||||
FAILEDOPERATION_CONFLICTOPERATION = 'FailedOperation.ConflictOperation'
|
||||
|
||||
# 增加人脸不支持并发操作。
|
||||
FAILEDOPERATION_CREATEFACECONCURRENT = 'FailedOperation.CreateFaceConcurrent'
|
||||
|
||||
# 同一人员库中自定义描述字段不可重复。
|
||||
FAILEDOPERATION_DUPLICATEDGROUPDESCRIPTION = 'FailedOperation.DuplicatedGroupDescription'
|
||||
|
||||
# 人脸图片质量不符要求。
|
||||
FAILEDOPERATION_FACEQUALITYNOTQUALIFIED = 'FailedOperation.FaceQualityNotQualified'
|
||||
|
||||
# 人脸框大小小于MinFaceSize设置,人脸被过滤。
|
||||
FAILEDOPERATION_FACESIZETOOSMALL = 'FailedOperation.FaceSizeTooSmall'
|
||||
|
||||
# 指定人员库的升级操作无法执行。
|
||||
FAILEDOPERATION_GROUPCANNOTUPGRADE = 'FailedOperation.GroupCannotUpgrade'
|
||||
|
||||
# 当前组正处于删除状态,请等待。
|
||||
FAILEDOPERATION_GROUPINDELETEDSTATE = 'FailedOperation.GroupInDeletedState'
|
||||
|
||||
# 组中已包含对应的人员Id。
|
||||
FAILEDOPERATION_GROUPPERSONMAPEXIST = 'FailedOperation.GroupPersonMapExist'
|
||||
|
||||
# 组中不包含对应的人员Id。
|
||||
FAILEDOPERATION_GROUPPERSONMAPNOTEXIST = 'FailedOperation.GroupPersonMapNotExist'
|
||||
|
||||
# 图片解码失败。
|
||||
FAILEDOPERATION_IMAGEDECODEFAILED = 'FailedOperation.ImageDecodeFailed'
|
||||
|
||||
# 图片下载错误。
|
||||
FAILEDOPERATION_IMAGEDOWNLOADERROR = 'FailedOperation.ImageDownloadError'
|
||||
|
||||
# 人脸检测失败。
|
||||
FAILEDOPERATION_IMAGEFACEDETECTFAILED = 'FailedOperation.ImageFacedetectFailed'
|
||||
|
||||
# 图片分辨率过大。
|
||||
FAILEDOPERATION_IMAGERESOLUTIONEXCEED = 'FailedOperation.ImageResolutionExceed'
|
||||
|
||||
# 图片短边分辨率小于64。
|
||||
FAILEDOPERATION_IMAGERESOLUTIONTOOSMALL = 'FailedOperation.ImageResolutionTooSmall'
|
||||
|
||||
# base64编码后的图片数据大小不超过5M。
|
||||
FAILEDOPERATION_IMAGESIZEEXCEED = 'FailedOperation.ImageSizeExceed'
|
||||
|
||||
# 任务无法回滚。
|
||||
FAILEDOPERATION_JOBCANNNOTROLLBACK = 'FailedOperation.JobCannnotRollback'
|
||||
|
||||
# 请求频率超过限制。
|
||||
FAILEDOPERATION_REQUESTLIMITEXCEEDED = 'FailedOperation.RequestLimitExceeded'
|
||||
|
||||
# 后端服务超时。
|
||||
FAILEDOPERATION_REQUESTTIMEOUT = 'FailedOperation.RequestTimeout'
|
||||
|
||||
# Rpc调用失败。
|
||||
FAILEDOPERATION_RPCFAIL = 'FailedOperation.RpcFail'
|
||||
|
||||
# 检索人脸个数超过限制。
|
||||
FAILEDOPERATION_SEARCHFACESEXCEED = 'FailedOperation.SearchFacesExceed'
|
||||
|
||||
# 算法服务异常,请重试。
|
||||
FAILEDOPERATION_SERVERERROR = 'FailedOperation.ServerError'
|
||||
|
||||
# 内部错误。
|
||||
FAILEDOPERATION_UNKNOWERROR = 'FailedOperation.UnKnowError'
|
||||
|
||||
# 人员库升级任务不存在。
|
||||
FAILEDOPERATION_UPGRADEJOBIDNOTEXIST = 'FailedOperation.UpgradeJobIdNotExist'
|
||||
|
||||
# 内部错误。
|
||||
INTERNALERROR = 'InternalError'
|
||||
|
||||
# 参数不合法。
|
||||
INVALIDPARAMETER_INVALIDPARAMETER = 'InvalidParameter.InvalidParameter'
|
||||
|
||||
# 账号脸数量超出限制。
|
||||
INVALIDPARAMETERVALUE_ACCOUNTFACENUMEXCEED = 'InvalidParameterValue.AccountFaceNumExceed'
|
||||
|
||||
# 删除人脸数量超出限制。每个人员至少需要包含一张人脸。
|
||||
INVALIDPARAMETERVALUE_DELETEFACENUMEXCEED = 'InvalidParameterValue.DeleteFaceNumExceed'
|
||||
|
||||
# FaceMatchThreshold参数不合法。
|
||||
INVALIDPARAMETERVALUE_FACEMATCHTHRESHOLDILLEGAL = 'InvalidParameterValue.FaceMatchThresholdIllegal'
|
||||
|
||||
# 算法模型版本不合法。
|
||||
INVALIDPARAMETERVALUE_FACEMODELVERSIONILLEGAL = 'InvalidParameterValue.FaceModelVersionIllegal'
|
||||
|
||||
# 人员库自定义描述字段数组长度超过限制。最多可以创建5个。
|
||||
INVALIDPARAMETERVALUE_GROUPEXDESCRIPTIONSEXCEED = 'InvalidParameterValue.GroupExDescriptionsExceed'
|
||||
|
||||
# 人员库自定义描述字段名称不可重复。
|
||||
INVALIDPARAMETERVALUE_GROUPEXDESCRIPTIONSNAMEIDENTICAL = 'InvalidParameterValue.GroupExDescriptionsNameIdentical'
|
||||
|
||||
# 人员库自定义描述字段名称包含非法字符。人员库自定义描述字段名称只支持中英文、-、_、数字。
|
||||
INVALIDPARAMETERVALUE_GROUPEXDESCRIPTIONSNAMEILLEGAL = 'InvalidParameterValue.GroupExDescriptionsNameIllegal'
|
||||
|
||||
# 人员库自定义描述字段名称长度超出限制。
|
||||
INVALIDPARAMETERVALUE_GROUPEXDESCRIPTIONSNAMETOOLONG = 'InvalidParameterValue.GroupExDescriptionsNameTooLong'
|
||||
|
||||
# 人员库人脸数量超出限制。
|
||||
INVALIDPARAMETERVALUE_GROUPFACENUMEXCEED = 'InvalidParameterValue.GroupFaceNumExceed'
|
||||
|
||||
# 人员库ID已经存在。人员库ID不可重复。
|
||||
INVALIDPARAMETERVALUE_GROUPIDALREADYEXIST = 'InvalidParameterValue.GroupIdAlreadyExist'
|
||||
|
||||
# 人员库ID包含非法字符。人员库ID只支持英文、数字、-%@#&_。
|
||||
INVALIDPARAMETERVALUE_GROUPIDILLEGAL = 'InvalidParameterValue.GroupIdIllegal'
|
||||
|
||||
# 人员库ID不存在。
|
||||
INVALIDPARAMETERVALUE_GROUPIDNOTEXIST = 'InvalidParameterValue.GroupIdNotExist'
|
||||
|
||||
# 对应的人员库ID在库中不存在。
|
||||
INVALIDPARAMETERVALUE_GROUPIDNOTEXISTS = 'InvalidParameterValue.GroupIdNotExists'
|
||||
|
||||
# 人员库ID超出长度限制。
|
||||
INVALIDPARAMETERVALUE_GROUPIDTOOLONG = 'InvalidParameterValue.GroupIdTooLong'
|
||||
|
||||
# 传入的人员库列表超过限制。
|
||||
INVALIDPARAMETERVALUE_GROUPIDSEXCEED = 'InvalidParameterValue.GroupIdsExceed'
|
||||
|
||||
# 人员库名称已经存在。人员库名称不可重复。
|
||||
INVALIDPARAMETERVALUE_GROUPNAMEALREADYEXIST = 'InvalidParameterValue.GroupNameAlreadyExist'
|
||||
|
||||
# 人员库名称包含非法字符。人员库名称只支持中英文、-、_、数字。
|
||||
INVALIDPARAMETERVALUE_GROUPNAMEILLEGAL = 'InvalidParameterValue.GroupNameIllegal'
|
||||
|
||||
# 人员库名称超出长度限制。
|
||||
INVALIDPARAMETERVALUE_GROUPNAMETOOLONG = 'InvalidParameterValue.GroupNameTooLong'
|
||||
|
||||
# 人员库数量超出限制。如需增加,请联系我们。
|
||||
INVALIDPARAMETERVALUE_GROUPNUMEXCEED = 'InvalidParameterValue.GroupNumExceed'
|
||||
|
||||
# 人员库数量超出限制。单个人员最多可被添加至100个人员库。
|
||||
INVALIDPARAMETERVALUE_GROUPNUMPERPERSONEXCEED = 'InvalidParameterValue.GroupNumPerPersonExceed'
|
||||
|
||||
# 人员库备注包含非法字符。人员库备注只支持中英文、-、_、数字。
|
||||
INVALIDPARAMETERVALUE_GROUPTAGILLEGAL = 'InvalidParameterValue.GroupTagIllegal'
|
||||
|
||||
# 人员库备注超出长度限制。
|
||||
INVALIDPARAMETERVALUE_GROUPTAGTOOLONG = 'InvalidParameterValue.GroupTagTooLong'
|
||||
|
||||
# 图片为空。
|
||||
INVALIDPARAMETERVALUE_IMAGEEMPTY = 'InvalidParameterValue.ImageEmpty'
|
||||
|
||||
# 图片为空。
|
||||
INVALIDPARAMETERVALUE_IMAGEEMPTYERROR = 'InvalidParameterValue.ImageEmptyError'
|
||||
|
||||
# 返回数量超出限制。
|
||||
INVALIDPARAMETERVALUE_LIMITEXCEED = 'InvalidParameterValue.LimitExceed'
|
||||
|
||||
# 指定分组中没有人脸。
|
||||
INVALIDPARAMETERVALUE_NOFACEINGROUPS = 'InvalidParameterValue.NoFaceInGroups'
|
||||
|
||||
# 图片中没有人脸。
|
||||
INVALIDPARAMETERVALUE_NOFACEINPHOTO = 'InvalidParameterValue.NoFaceInPhoto'
|
||||
|
||||
# 起始序号过大。请检查需要请求的数组长度。
|
||||
INVALIDPARAMETERVALUE_OFFSETEXCEED = 'InvalidParameterValue.OffsetExceed'
|
||||
|
||||
# 人员自定义描述字段数组长度超过限制。最多5个。
|
||||
INVALIDPARAMETERVALUE_PERSONEXDESCRIPTIONINFOSEXCEED = 'InvalidParameterValue.PersonExDescriptionInfosExceed'
|
||||
|
||||
# 人员自定义描述字段名称不可重复。
|
||||
INVALIDPARAMETERVALUE_PERSONEXDESCRIPTIONSNAMEIDENTICAL = 'InvalidParameterValue.PersonExDescriptionsNameIdentical'
|
||||
|
||||
# 人员自定义描述字段名称包含非法字符。人员自定义描述字段名称只支持中英文、-、_、数字。
|
||||
INVALIDPARAMETERVALUE_PERSONEXDESCRIPTIONSNAMEILLEGAL = 'InvalidParameterValue.PersonExDescriptionsNameIllegal'
|
||||
|
||||
# 人员自定义描述字段名称长度超出限制。
|
||||
INVALIDPARAMETERVALUE_PERSONEXDESCRIPTIONSNAMETOOLONG = 'InvalidParameterValue.PersonExDescriptionsNameTooLong'
|
||||
|
||||
# 组中已包含对应的人员Id。
|
||||
INVALIDPARAMETERVALUE_PERSONEXISTINGROUP = 'InvalidParameterValue.PersonExistInGroup'
|
||||
|
||||
# 人员人脸数量超出限制。单个人员最多可以包含五张人脸。
|
||||
INVALIDPARAMETERVALUE_PERSONFACENUMEXCEED = 'InvalidParameterValue.PersonFaceNumExceed'
|
||||
|
||||
# 人员性别设置出错。0代表未填写,1代表男性,2代表女性。
|
||||
INVALIDPARAMETERVALUE_PERSONGENDERILLEGAL = 'InvalidParameterValue.PersonGenderIllegal'
|
||||
|
||||
# 人员ID已经存在。人员ID不可重复。
|
||||
INVALIDPARAMETERVALUE_PERSONIDALREADYEXIST = 'InvalidParameterValue.PersonIdAlreadyExist'
|
||||
|
||||
# 人员ID包含非法字符。人员ID只支持英文、数字、-%@#&_。
|
||||
INVALIDPARAMETERVALUE_PERSONIDILLEGAL = 'InvalidParameterValue.PersonIdIllegal'
|
||||
|
||||
# 人员ID不存在。
|
||||
INVALIDPARAMETERVALUE_PERSONIDNOTEXIST = 'InvalidParameterValue.PersonIdNotExist'
|
||||
|
||||
# 人员ID超出长度限制。
|
||||
INVALIDPARAMETERVALUE_PERSONIDTOOLONG = 'InvalidParameterValue.PersonIdTooLong'
|
||||
|
||||
# 人员名称包含非法字符。人员名称只支持中英文、-、_、数字。
|
||||
INVALIDPARAMETERVALUE_PERSONNAMEILLEGAL = 'InvalidParameterValue.PersonNameIllegal'
|
||||
|
||||
# 人员名称超出长度限制。
|
||||
INVALIDPARAMETERVALUE_PERSONNAMETOOLONG = 'InvalidParameterValue.PersonNameTooLong'
|
||||
|
||||
# QualityControl参数不合法。
|
||||
INVALIDPARAMETERVALUE_QUALITYCONTROLILLEGAL = 'InvalidParameterValue.QualityControlIllegal'
|
||||
|
||||
# 搜索的人员数目超过限制。
|
||||
INVALIDPARAMETERVALUE_SEARCHPERSONSEXCEED = 'InvalidParameterValue.SearchPersonsExceed'
|
||||
|
||||
# UniquePersonControl参数不合法。
|
||||
INVALIDPARAMETERVALUE_UNIQUEPERSONCONTROLILLEGAL = 'InvalidParameterValue.UniquePersonControlIllegal'
|
||||
|
||||
# 该操作不支持算法模型版本2.0及以下版本。
|
||||
INVALIDPARAMETERVALUE_UNSUPPORTEDGROUPFACEMODELVERSION = 'InvalidParameterValue.UnsupportedGroupFaceModelVersion'
|
||||
|
||||
# 一次最多上传四张人脸。
|
||||
INVALIDPARAMETERVALUE_UPLOADFACENUMEXCEED = 'InvalidParameterValue.UploadFaceNumExceed'
|
||||
|
||||
# URL格式不合法。
|
||||
INVALIDPARAMETERVALUE_URLILLEGAL = 'InvalidParameterValue.UrlIllegal'
|
||||
|
||||
# 超过配额限制。
|
||||
LIMITEXCEEDED = 'LimitExceeded'
|
||||
|
||||
# 人脸个数超过限制。
|
||||
LIMITEXCEEDED_ERRORFACENUMEXCEED = 'LimitExceeded.ErrorFaceNumExceed'
|
||||
|
||||
# 必选参数为空。
|
||||
MISSINGPARAMETER_ERRORPARAMETEREMPTY = 'MissingParameter.ErrorParameterEmpty'
|
||||
|
||||
# 请求的次数超过了频率限制。
|
||||
REQUESTLIMITEXCEEDED = 'RequestLimitExceeded'
|
||||
|
||||
# 账号已欠费。
|
||||
RESOURCEUNAVAILABLE_CHARGESTATUSEXCEPTION = 'ResourceUnavailable.ChargeStatusException'
|
||||
|
||||
# 资源正在发货中。
|
||||
RESOURCEUNAVAILABLE_DELIVERING = 'ResourceUnavailable.Delivering'
|
||||
|
||||
# 账号已被冻结。
|
||||
RESOURCEUNAVAILABLE_FREEZE = 'ResourceUnavailable.Freeze'
|
||||
|
||||
# 获取认证信息失败。
|
||||
RESOURCEUNAVAILABLE_GETAUTHINFOERROR = 'ResourceUnavailable.GetAuthInfoError'
|
||||
|
||||
# 账号已欠费。
|
||||
RESOURCEUNAVAILABLE_INARREARS = 'ResourceUnavailable.InArrears'
|
||||
|
||||
# 余额不足。
|
||||
RESOURCEUNAVAILABLE_LOWBALANCE = 'ResourceUnavailable.LowBalance'
|
||||
|
||||
# 计费状态未知,请确认是否已在控制台开通服务。
|
||||
RESOURCEUNAVAILABLE_NOTEXIST = 'ResourceUnavailable.NotExist'
|
||||
|
||||
# 服务未开通。
|
||||
RESOURCEUNAVAILABLE_NOTREADY = 'ResourceUnavailable.NotReady'
|
||||
|
||||
# 资源已被回收。
|
||||
RESOURCEUNAVAILABLE_RECOVER = 'ResourceUnavailable.Recover'
|
||||
|
||||
# 账号已停服。
|
||||
RESOURCEUNAVAILABLE_STOPUSING = 'ResourceUnavailable.StopUsing'
|
||||
|
||||
# 计费状态未知。
|
||||
RESOURCEUNAVAILABLE_UNKNOWNSTATUS = 'ResourceUnavailable.UnknownStatus'
|
||||
|
||||
# 计费状态异常。
|
||||
RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = 'ResourcesSoldOut.ChargeStatusException'
|
||||
|
||||
# 未知方法名。
|
||||
UNSUPPORTEDOPERATION_UNKNOWMETHOD = 'UnsupportedOperation.UnknowMethod'
|
||||
@@ -0,0 +1,888 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
|
||||
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
|
||||
from tencentcloud.common.abstract_client import AbstractClient
|
||||
from tencentcloud.iai.v20180301 import models
|
||||
|
||||
|
||||
class IaiClient(AbstractClient):
|
||||
_apiVersion = '2018-03-01'
|
||||
_endpoint = 'iai.tencentcloudapi.com'
|
||||
_service = 'iai'
|
||||
|
||||
|
||||
def AnalyzeDenseLandmarks(self, request):
|
||||
r"""对请求图片进行五官定位(也称人脸关键点定位),获得人脸的精准信息,返回多达888点关键信息,对五官和脸部轮廓进行精确定位。
|
||||
|
||||
:param request: Request instance for AnalyzeDenseLandmarks.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.AnalyzeDenseLandmarksRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.AnalyzeDenseLandmarksResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("AnalyzeDenseLandmarks", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.AnalyzeDenseLandmarksResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def AnalyzeFace(self, request):
|
||||
r"""对请求图片进行五官定位(也称人脸关键点定位),计算构成人脸轮廓的 90 个点,包括眉毛(左右各 8 点)、眼睛(左右各 8 点)、鼻子(13 点)、嘴巴(22 点)、脸型轮廓(21 点)、眼珠[或瞳孔](2点)。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for AnalyzeFace.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.AnalyzeFaceRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.AnalyzeFaceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("AnalyzeFace", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.AnalyzeFaceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CompareFace(self, request):
|
||||
r"""对两张图片中的人脸进行相似度比对,返回人脸相似度分数。
|
||||
|
||||
若您需要判断 “此人是否是某人”,即验证某张图片中的人是否是已知身份的某人,如常见的人脸登录场景,建议使用[人脸验证](https://cloud.tencent.com/document/product/867/32806)或[人员验证](https://cloud.tencent.com/document/product/867/38879)接口。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for CompareFace.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.CompareFaceRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.CompareFaceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CompareFace", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CompareFaceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CopyPerson(self, request):
|
||||
r"""将已存在于某人员库的人员复制到其他人员库,该人员的描述信息不会被复制。单个人员最多只能同时存在100个人员库中。
|
||||
>
|
||||
- 注:若该人员创建时算法模型版本为2.0,复制到非2.0算法模型版本的Group中时,复制操作将会失败。
|
||||
|
||||
:param request: Request instance for CopyPerson.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.CopyPersonRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.CopyPersonResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CopyPerson", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CopyPersonResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreateFace(self, request):
|
||||
r"""将一组人脸图片添加到一个人员中。一个人员最多允许包含 5 张图片。若该人员存在多个人员库中,所有人员库中该人员图片均会增加。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for CreateFace.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.CreateFaceRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.CreateFaceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateFace", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateFaceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreateGroup(self, request):
|
||||
r"""用于创建一个空的人员库,如果人员库已存在返回错误。
|
||||
可根据需要创建自定义描述字段,用于辅助描述该人员库下的人员信息。
|
||||
|
||||
1个APPID下最多创建10万个人员库(Group)、最多包含5000万张人脸(Face)。
|
||||
|
||||
不同算法模型版本(FaceModelVersion)的人员库(Group)最多可包含人脸(Face)数不同。算法模型版本为2.0的人员库最多包含100万张人脸,算法模型版本为3.0的人员库最多可包含300万张人脸。
|
||||
|
||||
:param request: Request instance for CreateGroup.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.CreateGroupRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.CreateGroupResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateGroup", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateGroupResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreatePerson(self, request):
|
||||
r"""创建人员,添加人脸、姓名、性别及其他相关信息。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for CreatePerson.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.CreatePersonRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.CreatePersonResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreatePerson", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreatePersonResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteFace(self, request):
|
||||
r"""删除一个人员下的人脸图片。如果该人员只有一张人脸图片,则返回错误。
|
||||
|
||||
:param request: Request instance for DeleteFace.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.DeleteFaceRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.DeleteFaceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteFace", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteFaceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteGroup(self, request):
|
||||
r"""删除该人员库及包含的所有的人员。同时,人员对应的所有人脸信息将被删除。若某人员同时存在多个人员库中,该人员不会被删除,但属于该人员库中的自定义描述字段信息会被删除,属于其他人员库的自定义描述字段信息不受影响。
|
||||
|
||||
:param request: Request instance for DeleteGroup.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.DeleteGroupRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.DeleteGroupResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteGroup", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteGroupResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeletePerson(self, request):
|
||||
r"""删除该人员信息,此操作会导致所有人员库均删除此人员。同时,该人员的所有人脸信息将被删除。
|
||||
|
||||
:param request: Request instance for DeletePerson.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.DeletePersonRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.DeletePersonResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeletePerson", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeletePersonResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeletePersonFromGroup(self, request):
|
||||
r"""从某人员库中删除人员,此操作仅影响该人员库。若该人员仅存在于指定的人员库中,该人员将被删除,其所有的人脸信息也将被删除。
|
||||
|
||||
:param request: Request instance for DeletePersonFromGroup.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.DeletePersonFromGroupRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.DeletePersonFromGroupResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeletePersonFromGroup", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeletePersonFromGroupResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DetectFace(self, request):
|
||||
r"""检测给定图片中的人脸(Face)的位置、相应的面部属性和人脸质量信息,位置包括 (x,y,w,h),面部属性包括性别(gender)、年龄(age)、表情(expression)、魅力(beauty)、眼镜(glass)、发型(hair)、口罩(mask)和姿态 (pitch,roll,yaw),人脸质量信息包括整体质量分(score)、模糊分(sharpness)、光照分(brightness)和五官遮挡分(completeness)。
|
||||
|
||||
|
||||
其中,人脸质量信息主要用于评价输入的人脸图片的质量。在使用人脸识别服务时,建议您对输入的人脸图片进行质量检测,提升后续业务处理的效果。该功能的应用场景包括:
|
||||
|
||||
1) 人员库[创建人员](https://cloud.tencent.com/document/product/867/32793)/[增加人脸](https://cloud.tencent.com/document/product/867/32795):保证人员人脸信息的质量,便于后续的业务处理。
|
||||
|
||||
2) [人脸搜索](https://cloud.tencent.com/document/product/867/32798):保证输入的图片质量,快速准确匹配到对应的人员。
|
||||
|
||||
3) [人脸验证](https://cloud.tencent.com/document/product/867/32806):保证人脸信息的质量,避免明明是本人却认证不通过的情况。
|
||||
|
||||
4) [人脸融合](https://cloud.tencent.com/product/facefusion):保证上传的人脸质量,人脸融合的效果更好。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for DetectFace.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.DetectFaceRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.DetectFaceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DetectFace", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DetectFaceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DetectFaceAttributes(self, request):
|
||||
r"""检测给定图片中的人脸(Face)的位置、相应的面部属性和人脸质量信息,位置包括 (x,y,w,h),面部属性包括性别(gender)、年龄(age)、表情(expression)、魅力(beauty)、眼镜(glass)、发型(hair)、口罩(mask)和姿态 (pitch,roll,yaw),人脸质量信息包括整体质量分(score)、模糊分(sharpness)、光照分(brightness)和五官遮挡分(completeness)。
|
||||
|
||||
|
||||
其中,人脸质量信息主要用于评价输入的人脸图片的质量。在使用人脸识别服务时,建议您对输入的人脸图片进行质量检测,提升后续业务处理的效果。该功能的应用场景包括:
|
||||
|
||||
1) 人员库[创建人员](https://cloud.tencent.com/document/product/867/32793)/[增加人脸](https://cloud.tencent.com/document/product/867/32795):保证人员人脸信息的质量,便于后续的业务处理。
|
||||
|
||||
2) [人脸搜索](https://cloud.tencent.com/document/product/867/32798):保证输入的图片质量,快速准确匹配到对应的人员。
|
||||
|
||||
3) [人脸验证](https://cloud.tencent.com/document/product/867/32806):保证人脸信息的质量,避免明明是本人却认证不通过的情况。
|
||||
|
||||
4) [人脸融合](https://cloud.tencent.com/product/facefusion):保证上传的人脸质量,人脸融合的效果更好。
|
||||
|
||||
>
|
||||
- 本接口是[人脸检测与分析](https://cloud.tencent.com/document/product/867/32800)的升级,具体在于:
|
||||
|
||||
1.本接口可以指定需要计算返回的人脸属性,避免无效计算,降低耗时;
|
||||
|
||||
2.本接口支持更多属性细项数,也会持续增加更多功能。
|
||||
|
||||
请您使用本接口完成相应的人脸检测与属性分析需求。
|
||||
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for DetectFaceAttributes.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.DetectFaceAttributesRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.DetectFaceAttributesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DetectFaceAttributes", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DetectFaceAttributesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetGroupInfo(self, request):
|
||||
r"""获取人员库信息。
|
||||
|
||||
:param request: Request instance for GetGroupInfo.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetGroupInfoRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetGroupInfoResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetGroupInfo", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetGroupInfoResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetGroupList(self, request):
|
||||
r"""获取人员库列表。
|
||||
|
||||
:param request: Request instance for GetGroupList.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetGroupListRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetGroupListResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetGroupList", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetGroupListResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetPersonBaseInfo(self, request):
|
||||
r"""获取指定人员的信息,包括姓名、性别、人脸等。
|
||||
|
||||
:param request: Request instance for GetPersonBaseInfo.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetPersonBaseInfoRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetPersonBaseInfoResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetPersonBaseInfo", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetPersonBaseInfoResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetPersonGroupInfo(self, request):
|
||||
r"""获取指定人员的信息,包括加入的人员库、描述内容等。
|
||||
|
||||
:param request: Request instance for GetPersonGroupInfo.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetPersonGroupInfoRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetPersonGroupInfoResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetPersonGroupInfo", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetPersonGroupInfoResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetPersonList(self, request):
|
||||
r"""获取指定人员库中的人员列表。
|
||||
|
||||
:param request: Request instance for GetPersonList.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetPersonListRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetPersonListResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetPersonList", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetPersonListResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetPersonListNum(self, request):
|
||||
r"""获取指定人员库中人员数量。
|
||||
|
||||
:param request: Request instance for GetPersonListNum.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetPersonListNumRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetPersonListNumResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetPersonListNum", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetPersonListNumResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetUpgradeGroupFaceModelVersionJobList(self, request):
|
||||
r"""避免官网歧义
|
||||
|
||||
获取人员库升级任务列表
|
||||
|
||||
:param request: Request instance for GetUpgradeGroupFaceModelVersionJobList.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetUpgradeGroupFaceModelVersionJobListRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetUpgradeGroupFaceModelVersionJobListResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetUpgradeGroupFaceModelVersionJobList", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetUpgradeGroupFaceModelVersionJobListResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetUpgradeGroupFaceModelVersionResult(self, request):
|
||||
r"""避免官网歧义
|
||||
|
||||
人员库升级结果查询
|
||||
|
||||
:param request: Request instance for GetUpgradeGroupFaceModelVersionResult.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.GetUpgradeGroupFaceModelVersionResultRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.GetUpgradeGroupFaceModelVersionResultResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetUpgradeGroupFaceModelVersionResult", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetUpgradeGroupFaceModelVersionResultResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def ModifyGroup(self, request):
|
||||
r"""修改人员库名称、备注、自定义描述字段名称。
|
||||
|
||||
:param request: Request instance for ModifyGroup.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.ModifyGroupRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.ModifyGroupResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("ModifyGroup", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.ModifyGroupResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def ModifyPersonBaseInfo(self, request):
|
||||
r"""修改人员信息,包括名称、性别等。人员名称和性别修改会同步到包含该人员的所有人员库。
|
||||
|
||||
:param request: Request instance for ModifyPersonBaseInfo.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.ModifyPersonBaseInfoRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.ModifyPersonBaseInfoResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("ModifyPersonBaseInfo", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.ModifyPersonBaseInfoResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def ModifyPersonGroupInfo(self, request):
|
||||
r"""修改指定人员库人员描述内容。
|
||||
|
||||
:param request: Request instance for ModifyPersonGroupInfo.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.ModifyPersonGroupInfoRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.ModifyPersonGroupInfoResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("ModifyPersonGroupInfo", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.ModifyPersonGroupInfoResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def RevertGroupFaceModelVersion(self, request):
|
||||
r"""此接口文档早已废弃,为了避免官网18版本存留歧义,需要下线
|
||||
|
||||
本接口用于回滚人员库的人脸识别算法模型版本。单个人员库有且仅有一次回滚机会。
|
||||
|
||||
回滚操作会在10s内生效,回滚操作中,您对人员库的操作可能会失效。
|
||||
|
||||
:param request: Request instance for RevertGroupFaceModelVersion.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.RevertGroupFaceModelVersionRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.RevertGroupFaceModelVersionResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("RevertGroupFaceModelVersion", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.RevertGroupFaceModelVersionResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def SearchFaces(self, request):
|
||||
r"""用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,识别结果按照相似度从大到小排序。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持一次性跨 100 个人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
与[人员搜索](https://cloud.tencent.com/document/product/867/38881)及[人员搜索按库返回](https://cloud.tencent.com/document/product/867/38880)接口不同的是,本接口将该人员(Person)下的每个人脸(Face)都作为单独个体进行验证,而人员搜索及人员搜索按库返回接口 会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个Person下有4张 Face,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使搜索更加准确。
|
||||
|
||||
|
||||
本接口需与[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)结合使用。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for SearchFaces.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.SearchFacesRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.SearchFacesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("SearchFaces", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.SearchFacesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def SearchFacesReturnsByGroup(self, request):
|
||||
r"""用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,按照**人员库的维度**以人员相似度从大到小顺序排列。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持跨人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
与[人员搜索](https://cloud.tencent.com/document/product/867/38881)及[人员搜索按库返回](https://cloud.tencent.com/document/product/867/38880)接口不同的是,本接口将该人员(Person)下的每个人脸(Face)都作为单独个体进行验证,而[人员搜索](https://cloud.tencent.com/document/product/867/38881)及[人员搜索按库返回](https://cloud.tencent.com/document/product/867/38880)接口 会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个Person下有4张 Face,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使搜索更加准确。
|
||||
|
||||
本接口需与[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)结合使用。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for SearchFacesReturnsByGroup.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.SearchFacesReturnsByGroupRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.SearchFacesReturnsByGroupResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("SearchFacesReturnsByGroup", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.SearchFacesReturnsByGroupResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def SearchPersons(self, request):
|
||||
r"""用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,按照相似度从大到小排列。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持一次性跨 100 个人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
本接口会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个 Person 下有4张 Face ,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员搜索(确定待识别的人脸图片是某人)更加准确。而[人脸搜索](https://cloud.tencent.com/document/product/867/32798)及[人脸搜索按库返回接口](https://cloud.tencent.com/document/product/867/38882)将该人员(Person)下的每个人脸(Face)都作为单独个体进行搜索。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
- 仅支持算法模型版本(FaceModelVersion)为3.0的人员库。
|
||||
|
||||
:param request: Request instance for SearchPersons.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.SearchPersonsRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.SearchPersonsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("SearchPersons", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.SearchPersonsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def SearchPersonsReturnsByGroup(self, request):
|
||||
r"""用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,按照**人员库的维度**以人员相似度从大到小顺序排列。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持跨人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
本接口会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个 Person 下有4张 Face ,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员搜索(确定待识别的人脸图片是某人)更加准确。而[人脸搜索](https://cloud.tencent.com/document/product/867/32798)及[人脸搜索按库返回接口](https://cloud.tencent.com/document/product/867/38882)将该人员(Person)下的每个人脸(Face)都作为单独个体进行搜索。
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
- 仅支持算法模型版本(FaceModelVersion)为3.0的人员库。
|
||||
|
||||
:param request: Request instance for SearchPersonsReturnsByGroup.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.SearchPersonsReturnsByGroupRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.SearchPersonsReturnsByGroupResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("SearchPersonsReturnsByGroup", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.SearchPersonsReturnsByGroupResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def UpgradeGroupFaceModelVersion(self, request):
|
||||
r"""接口已经不使用了,需要下线掉,以免留在官网产生歧义
|
||||
|
||||
升级人员库。升级过程中,人员库仍然为原算法版本,人员库相关操作仍然支持。升级完成后,人员库为新算法版本。
|
||||
单个人员库有且仅支持一次回滚操作。
|
||||
注:此处QPS限制为10。
|
||||
|
||||
:param request: Request instance for UpgradeGroupFaceModelVersion.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.UpgradeGroupFaceModelVersionRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.UpgradeGroupFaceModelVersionResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("UpgradeGroupFaceModelVersion", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.UpgradeGroupFaceModelVersionResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def VerifyFace(self, request):
|
||||
r"""给定一张人脸图片和一个 PersonId,判断图片中的人和 PersonId 对应的人是否为同一人。PersonId 请参考[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)。
|
||||
|
||||
与[人脸比对](https://cloud.tencent.com/document/product/867/32802)接口不同的是,人脸验证用于判断 “此人是否是此人”,“此人”的信息已存于人员库中,“此人”可能存在多张人脸图片;而[人脸比对](https://cloud.tencent.com/document/product/867/32802)用于判断两张人脸的相似度。
|
||||
|
||||
与[人员验证](https://cloud.tencent.com/document/product/867/38879)接口不同的是,人脸验证将该人员(Person)下的每个人脸(Face)都作为单独个体进行验证,而[人员验证](https://cloud.tencent.com/document/product/867/38879)会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个 Person下有4张 Face,人员验证接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员验证(确定待识别的人脸图片是某人员)更加准确。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
|
||||
:param request: Request instance for VerifyFace.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.VerifyFaceRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.VerifyFaceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("VerifyFace", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.VerifyFaceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def VerifyPerson(self, request):
|
||||
r"""给定一张人脸图片和一个 PersonId,判断图片中的人和 PersonId 对应的人是否为同一人。PersonId 请参考[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)。
|
||||
本接口会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个Person下有4张 Face,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员验证(确定待识别的人脸图片是某人员)更加准确。
|
||||
|
||||
和人脸比对相关接口不同的是,人脸验证相关接口用于判断 “此人是否是此人”,“此人”的信息已存于人员库中,“此人”可能存在多张人脸图片;而人脸比对相关接口用于判断两张人脸的相似度。
|
||||
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
- 仅支持算法模型版本(FaceModelVersion)为3.0的人员库。
|
||||
|
||||
:param request: Request instance for VerifyPerson.
|
||||
:type request: :class:`tencentcloud.iai.v20180301.models.VerifyPersonRequest`
|
||||
:rtype: :class:`tencentcloud.iai.v20180301.models.VerifyPersonResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("VerifyPerson", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.VerifyPersonResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
@@ -0,0 +1,728 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
|
||||
from tencentcloud.common.abstract_client_async import AbstractClient
|
||||
from tencentcloud.iai.v20180301 import models
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class IaiClient(AbstractClient):
|
||||
_apiVersion = '2018-03-01'
|
||||
_endpoint = 'iai.tencentcloudapi.com'
|
||||
_service = 'iai'
|
||||
|
||||
async def AnalyzeDenseLandmarks(
|
||||
self,
|
||||
request: models.AnalyzeDenseLandmarksRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.AnalyzeDenseLandmarksResponse:
|
||||
"""
|
||||
对请求图片进行五官定位(也称人脸关键点定位),获得人脸的精准信息,返回多达888点关键信息,对五官和脸部轮廓进行精确定位。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "AnalyzeDenseLandmarks"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.AnalyzeDenseLandmarksResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def AnalyzeFace(
|
||||
self,
|
||||
request: models.AnalyzeFaceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.AnalyzeFaceResponse:
|
||||
"""
|
||||
对请求图片进行五官定位(也称人脸关键点定位),计算构成人脸轮廓的 90 个点,包括眉毛(左右各 8 点)、眼睛(左右各 8 点)、鼻子(13 点)、嘴巴(22 点)、脸型轮廓(21 点)、眼珠[或瞳孔](2点)。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "AnalyzeFace"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.AnalyzeFaceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CompareFace(
|
||||
self,
|
||||
request: models.CompareFaceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CompareFaceResponse:
|
||||
"""
|
||||
对两张图片中的人脸进行相似度比对,返回人脸相似度分数。
|
||||
|
||||
若您需要判断 “此人是否是某人”,即验证某张图片中的人是否是已知身份的某人,如常见的人脸登录场景,建议使用[人脸验证](https://cloud.tencent.com/document/product/867/32806)或[人员验证](https://cloud.tencent.com/document/product/867/38879)接口。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CompareFace"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CompareFaceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CopyPerson(
|
||||
self,
|
||||
request: models.CopyPersonRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CopyPersonResponse:
|
||||
"""
|
||||
将已存在于某人员库的人员复制到其他人员库,该人员的描述信息不会被复制。单个人员最多只能同时存在100个人员库中。
|
||||
>
|
||||
- 注:若该人员创建时算法模型版本为2.0,复制到非2.0算法模型版本的Group中时,复制操作将会失败。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CopyPerson"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CopyPersonResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreateFace(
|
||||
self,
|
||||
request: models.CreateFaceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateFaceResponse:
|
||||
"""
|
||||
将一组人脸图片添加到一个人员中。一个人员最多允许包含 5 张图片。若该人员存在多个人员库中,所有人员库中该人员图片均会增加。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateFace"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateFaceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreateGroup(
|
||||
self,
|
||||
request: models.CreateGroupRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateGroupResponse:
|
||||
"""
|
||||
用于创建一个空的人员库,如果人员库已存在返回错误。
|
||||
可根据需要创建自定义描述字段,用于辅助描述该人员库下的人员信息。
|
||||
|
||||
1个APPID下最多创建10万个人员库(Group)、最多包含5000万张人脸(Face)。
|
||||
|
||||
不同算法模型版本(FaceModelVersion)的人员库(Group)最多可包含人脸(Face)数不同。算法模型版本为2.0的人员库最多包含100万张人脸,算法模型版本为3.0的人员库最多可包含300万张人脸。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateGroup"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateGroupResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreatePerson(
|
||||
self,
|
||||
request: models.CreatePersonRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreatePersonResponse:
|
||||
"""
|
||||
创建人员,添加人脸、姓名、性别及其他相关信息。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreatePerson"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreatePersonResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteFace(
|
||||
self,
|
||||
request: models.DeleteFaceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteFaceResponse:
|
||||
"""
|
||||
删除一个人员下的人脸图片。如果该人员只有一张人脸图片,则返回错误。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteFace"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteFaceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteGroup(
|
||||
self,
|
||||
request: models.DeleteGroupRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteGroupResponse:
|
||||
"""
|
||||
删除该人员库及包含的所有的人员。同时,人员对应的所有人脸信息将被删除。若某人员同时存在多个人员库中,该人员不会被删除,但属于该人员库中的自定义描述字段信息会被删除,属于其他人员库的自定义描述字段信息不受影响。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteGroup"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteGroupResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeletePerson(
|
||||
self,
|
||||
request: models.DeletePersonRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeletePersonResponse:
|
||||
"""
|
||||
删除该人员信息,此操作会导致所有人员库均删除此人员。同时,该人员的所有人脸信息将被删除。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeletePerson"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeletePersonResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeletePersonFromGroup(
|
||||
self,
|
||||
request: models.DeletePersonFromGroupRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeletePersonFromGroupResponse:
|
||||
"""
|
||||
从某人员库中删除人员,此操作仅影响该人员库。若该人员仅存在于指定的人员库中,该人员将被删除,其所有的人脸信息也将被删除。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeletePersonFromGroup"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeletePersonFromGroupResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DetectFace(
|
||||
self,
|
||||
request: models.DetectFaceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DetectFaceResponse:
|
||||
"""
|
||||
检测给定图片中的人脸(Face)的位置、相应的面部属性和人脸质量信息,位置包括 (x,y,w,h),面部属性包括性别(gender)、年龄(age)、表情(expression)、魅力(beauty)、眼镜(glass)、发型(hair)、口罩(mask)和姿态 (pitch,roll,yaw),人脸质量信息包括整体质量分(score)、模糊分(sharpness)、光照分(brightness)和五官遮挡分(completeness)。
|
||||
|
||||
|
||||
其中,人脸质量信息主要用于评价输入的人脸图片的质量。在使用人脸识别服务时,建议您对输入的人脸图片进行质量检测,提升后续业务处理的效果。该功能的应用场景包括:
|
||||
|
||||
1) 人员库[创建人员](https://cloud.tencent.com/document/product/867/32793)/[增加人脸](https://cloud.tencent.com/document/product/867/32795):保证人员人脸信息的质量,便于后续的业务处理。
|
||||
|
||||
2) [人脸搜索](https://cloud.tencent.com/document/product/867/32798):保证输入的图片质量,快速准确匹配到对应的人员。
|
||||
|
||||
3) [人脸验证](https://cloud.tencent.com/document/product/867/32806):保证人脸信息的质量,避免明明是本人却认证不通过的情况。
|
||||
|
||||
4) [人脸融合](https://cloud.tencent.com/product/facefusion):保证上传的人脸质量,人脸融合的效果更好。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DetectFace"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DetectFaceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DetectFaceAttributes(
|
||||
self,
|
||||
request: models.DetectFaceAttributesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DetectFaceAttributesResponse:
|
||||
"""
|
||||
检测给定图片中的人脸(Face)的位置、相应的面部属性和人脸质量信息,位置包括 (x,y,w,h),面部属性包括性别(gender)、年龄(age)、表情(expression)、魅力(beauty)、眼镜(glass)、发型(hair)、口罩(mask)和姿态 (pitch,roll,yaw),人脸质量信息包括整体质量分(score)、模糊分(sharpness)、光照分(brightness)和五官遮挡分(completeness)。
|
||||
|
||||
|
||||
其中,人脸质量信息主要用于评价输入的人脸图片的质量。在使用人脸识别服务时,建议您对输入的人脸图片进行质量检测,提升后续业务处理的效果。该功能的应用场景包括:
|
||||
|
||||
1) 人员库[创建人员](https://cloud.tencent.com/document/product/867/32793)/[增加人脸](https://cloud.tencent.com/document/product/867/32795):保证人员人脸信息的质量,便于后续的业务处理。
|
||||
|
||||
2) [人脸搜索](https://cloud.tencent.com/document/product/867/32798):保证输入的图片质量,快速准确匹配到对应的人员。
|
||||
|
||||
3) [人脸验证](https://cloud.tencent.com/document/product/867/32806):保证人脸信息的质量,避免明明是本人却认证不通过的情况。
|
||||
|
||||
4) [人脸融合](https://cloud.tencent.com/product/facefusion):保证上传的人脸质量,人脸融合的效果更好。
|
||||
|
||||
>
|
||||
- 本接口是[人脸检测与分析](https://cloud.tencent.com/document/product/867/32800)的升级,具体在于:
|
||||
|
||||
1.本接口可以指定需要计算返回的人脸属性,避免无效计算,降低耗时;
|
||||
|
||||
2.本接口支持更多属性细项数,也会持续增加更多功能。
|
||||
|
||||
请您使用本接口完成相应的人脸检测与属性分析需求。
|
||||
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DetectFaceAttributes"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DetectFaceAttributesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetGroupInfo(
|
||||
self,
|
||||
request: models.GetGroupInfoRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetGroupInfoResponse:
|
||||
"""
|
||||
获取人员库信息。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetGroupInfo"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetGroupInfoResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetGroupList(
|
||||
self,
|
||||
request: models.GetGroupListRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetGroupListResponse:
|
||||
"""
|
||||
获取人员库列表。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetGroupList"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetGroupListResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetPersonBaseInfo(
|
||||
self,
|
||||
request: models.GetPersonBaseInfoRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetPersonBaseInfoResponse:
|
||||
"""
|
||||
获取指定人员的信息,包括姓名、性别、人脸等。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetPersonBaseInfo"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetPersonBaseInfoResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetPersonGroupInfo(
|
||||
self,
|
||||
request: models.GetPersonGroupInfoRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetPersonGroupInfoResponse:
|
||||
"""
|
||||
获取指定人员的信息,包括加入的人员库、描述内容等。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetPersonGroupInfo"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetPersonGroupInfoResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetPersonList(
|
||||
self,
|
||||
request: models.GetPersonListRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetPersonListResponse:
|
||||
"""
|
||||
获取指定人员库中的人员列表。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetPersonList"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetPersonListResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetPersonListNum(
|
||||
self,
|
||||
request: models.GetPersonListNumRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetPersonListNumResponse:
|
||||
"""
|
||||
获取指定人员库中人员数量。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetPersonListNum"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetPersonListNumResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetUpgradeGroupFaceModelVersionJobList(
|
||||
self,
|
||||
request: models.GetUpgradeGroupFaceModelVersionJobListRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetUpgradeGroupFaceModelVersionJobListResponse:
|
||||
"""
|
||||
避免官网歧义
|
||||
|
||||
获取人员库升级任务列表
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetUpgradeGroupFaceModelVersionJobList"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetUpgradeGroupFaceModelVersionJobListResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetUpgradeGroupFaceModelVersionResult(
|
||||
self,
|
||||
request: models.GetUpgradeGroupFaceModelVersionResultRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetUpgradeGroupFaceModelVersionResultResponse:
|
||||
"""
|
||||
避免官网歧义
|
||||
|
||||
人员库升级结果查询
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetUpgradeGroupFaceModelVersionResult"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetUpgradeGroupFaceModelVersionResultResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def ModifyGroup(
|
||||
self,
|
||||
request: models.ModifyGroupRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.ModifyGroupResponse:
|
||||
"""
|
||||
修改人员库名称、备注、自定义描述字段名称。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "ModifyGroup"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.ModifyGroupResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def ModifyPersonBaseInfo(
|
||||
self,
|
||||
request: models.ModifyPersonBaseInfoRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.ModifyPersonBaseInfoResponse:
|
||||
"""
|
||||
修改人员信息,包括名称、性别等。人员名称和性别修改会同步到包含该人员的所有人员库。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "ModifyPersonBaseInfo"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.ModifyPersonBaseInfoResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def ModifyPersonGroupInfo(
|
||||
self,
|
||||
request: models.ModifyPersonGroupInfoRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.ModifyPersonGroupInfoResponse:
|
||||
"""
|
||||
修改指定人员库人员描述内容。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "ModifyPersonGroupInfo"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.ModifyPersonGroupInfoResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def RevertGroupFaceModelVersion(
|
||||
self,
|
||||
request: models.RevertGroupFaceModelVersionRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.RevertGroupFaceModelVersionResponse:
|
||||
"""
|
||||
此接口文档早已废弃,为了避免官网18版本存留歧义,需要下线
|
||||
|
||||
本接口用于回滚人员库的人脸识别算法模型版本。单个人员库有且仅有一次回滚机会。
|
||||
|
||||
回滚操作会在10s内生效,回滚操作中,您对人员库的操作可能会失效。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "RevertGroupFaceModelVersion"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.RevertGroupFaceModelVersionResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def SearchFaces(
|
||||
self,
|
||||
request: models.SearchFacesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.SearchFacesResponse:
|
||||
"""
|
||||
用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,识别结果按照相似度从大到小排序。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持一次性跨 100 个人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
与[人员搜索](https://cloud.tencent.com/document/product/867/38881)及[人员搜索按库返回](https://cloud.tencent.com/document/product/867/38880)接口不同的是,本接口将该人员(Person)下的每个人脸(Face)都作为单独个体进行验证,而人员搜索及人员搜索按库返回接口 会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个Person下有4张 Face,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使搜索更加准确。
|
||||
|
||||
|
||||
本接口需与[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)结合使用。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "SearchFaces"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.SearchFacesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def SearchFacesReturnsByGroup(
|
||||
self,
|
||||
request: models.SearchFacesReturnsByGroupRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.SearchFacesReturnsByGroupResponse:
|
||||
"""
|
||||
用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,按照**人员库的维度**以人员相似度从大到小顺序排列。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持跨人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
与[人员搜索](https://cloud.tencent.com/document/product/867/38881)及[人员搜索按库返回](https://cloud.tencent.com/document/product/867/38880)接口不同的是,本接口将该人员(Person)下的每个人脸(Face)都作为单独个体进行验证,而[人员搜索](https://cloud.tencent.com/document/product/867/38881)及[人员搜索按库返回](https://cloud.tencent.com/document/product/867/38880)接口 会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个Person下有4张 Face,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使搜索更加准确。
|
||||
|
||||
本接口需与[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)结合使用。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "SearchFacesReturnsByGroup"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.SearchFacesReturnsByGroupResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def SearchPersons(
|
||||
self,
|
||||
request: models.SearchPersonsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.SearchPersonsResponse:
|
||||
"""
|
||||
用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,按照相似度从大到小排列。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持一次性跨 100 个人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
本接口会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个 Person 下有4张 Face ,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员搜索(确定待识别的人脸图片是某人)更加准确。而[人脸搜索](https://cloud.tencent.com/document/product/867/32798)及[人脸搜索按库返回接口](https://cloud.tencent.com/document/product/867/38882)将该人员(Person)下的每个人脸(Face)都作为单独个体进行搜索。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
- 仅支持算法模型版本(FaceModelVersion)为3.0的人员库。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "SearchPersons"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.SearchPersonsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def SearchPersonsReturnsByGroup(
|
||||
self,
|
||||
request: models.SearchPersonsReturnsByGroupRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.SearchPersonsReturnsByGroupResponse:
|
||||
"""
|
||||
用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,按照**人员库的维度**以人员相似度从大到小顺序排列。
|
||||
|
||||
支持一次性识别图片中的最多 10 张人脸,支持跨人员库(Group)搜索。
|
||||
|
||||
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
|
||||
|
||||
本接口会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个 Person 下有4张 Face ,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员搜索(确定待识别的人脸图片是某人)更加准确。而[人脸搜索](https://cloud.tencent.com/document/product/867/32798)及[人脸搜索按库返回接口](https://cloud.tencent.com/document/product/867/38882)将该人员(Person)下的每个人脸(Face)都作为单独个体进行搜索。
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
- 仅支持算法模型版本(FaceModelVersion)为3.0的人员库。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "SearchPersonsReturnsByGroup"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.SearchPersonsReturnsByGroupResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def UpgradeGroupFaceModelVersion(
|
||||
self,
|
||||
request: models.UpgradeGroupFaceModelVersionRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.UpgradeGroupFaceModelVersionResponse:
|
||||
"""
|
||||
接口已经不使用了,需要下线掉,以免留在官网产生歧义
|
||||
|
||||
升级人员库。升级过程中,人员库仍然为原算法版本,人员库相关操作仍然支持。升级完成后,人员库为新算法版本。
|
||||
单个人员库有且仅支持一次回滚操作。
|
||||
注:此处QPS限制为10。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "UpgradeGroupFaceModelVersion"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.UpgradeGroupFaceModelVersionResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def VerifyFace(
|
||||
self,
|
||||
request: models.VerifyFaceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.VerifyFaceResponse:
|
||||
"""
|
||||
给定一张人脸图片和一个 PersonId,判断图片中的人和 PersonId 对应的人是否为同一人。PersonId 请参考[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)。
|
||||
|
||||
与[人脸比对](https://cloud.tencent.com/document/product/867/32802)接口不同的是,人脸验证用于判断 “此人是否是此人”,“此人”的信息已存于人员库中,“此人”可能存在多张人脸图片;而[人脸比对](https://cloud.tencent.com/document/product/867/32802)用于判断两张人脸的相似度。
|
||||
|
||||
与[人员验证](https://cloud.tencent.com/document/product/867/38879)接口不同的是,人脸验证将该人员(Person)下的每个人脸(Face)都作为单独个体进行验证,而[人员验证](https://cloud.tencent.com/document/product/867/38879)会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个 Person下有4张 Face,人员验证接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员验证(确定待识别的人脸图片是某人员)更加准确。
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "VerifyFace"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.VerifyFaceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def VerifyPerson(
|
||||
self,
|
||||
request: models.VerifyPersonRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.VerifyPersonResponse:
|
||||
"""
|
||||
给定一张人脸图片和一个 PersonId,判断图片中的人和 PersonId 对应的人是否为同一人。PersonId 请参考[人员库管理相关接口](https://cloud.tencent.com/document/product/867/32794)。
|
||||
本接口会将该人员(Person)下的所有人脸(Face)进行融合特征处理,即若某个Person下有4张 Face,本接口会将4张 Face 的特征进行融合处理,生成对应这个 Person 的特征,使人员验证(确定待识别的人脸图片是某人员)更加准确。
|
||||
|
||||
和人脸比对相关接口不同的是,人脸验证相关接口用于判断 “此人是否是此人”,“此人”的信息已存于人员库中,“此人”可能存在多张人脸图片;而人脸比对相关接口用于判断两张人脸的相似度。
|
||||
|
||||
|
||||
>
|
||||
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
||||
- 仅支持算法模型版本(FaceModelVersion)为3.0的人员库。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "VerifyPerson"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.VerifyPersonResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user