lib/v20210903/client.rb in tencentcloud-sdk-ivld-1.0.249 vs lib/v20210903/client.rb in tencentcloud-sdk-ivld-1.0.250

- old
+ new

@@ -27,10 +27,149 @@ sdk_version = 'IVLD_' + File.read(File.expand_path('../VERSION', __dir__)).strip super(credential, region, api_version, api_endpoint, sdk_version, profile) end + # 增加自定义人脸图片,每个自定义人物最多可包含5张人脸图片 + + # 请注意,与创建自定义人物一样,图片数据优先级优于图片URL优先级 + + # @param request: Request instance for AddCustomPersonImage. + # @type request: :class:`Tencentcloud::ivld::V20210903::AddCustomPersonImageRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::AddCustomPersonImageResponse` + def AddCustomPersonImage(request) + body = send_request('AddCustomPersonImage', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = AddCustomPersonImageResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 创建自定义人物分类信息 + + # 当L2Category为空时,将创建一级自定义分类。 + # 当L1Category与L2Category均不为空时,将创建二级自定义分类。请注意,**只有当一级自定义分类存在时,才可创建二级自定义分类**。 + + # @param request: Request instance for CreateCustomCategory. + # @type request: :class:`Tencentcloud::ivld::V20210903::CreateCustomCategoryRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::CreateCustomCategoryResponse` + def CreateCustomCategory(request) + body = send_request('CreateCustomCategory', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = CreateCustomCategoryResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 创建自定义人物库 + + # Bucket的格式参考为 `bucketName-123456.cos.ap-shanghai.myqcloud.com` + + # 在调用CreateCustomPerson和AddCustomPersonImage接口之前,请先确保本接口成功调用。当前每个用户只支持一个自定义人物库,一旦自定义人物库创建成功,后续接口调用均会返回人物库已存在错误。 + + # 由于人脸图片对于自定义人物识别至关重要,因此自定义人物识别功能需要用户显式指定COS存储桶方可使用。具体来说,自定义人物识别功能接口(主要是CreateCustomPerson和AddCustomPersonImage)会在此COS桶下面新建IVLDCustomPersonImage目录,并在此目录下存储自定义人物图片数据以支持后续潜在的特征更新。 + + # 请注意:本接口指定的COS桶仅用于**备份存储自定义人物图片**,CreateCustomPerson和AddCustomPersonImage接口入参URL可使用任意COS存储桶下的任意图片。 + + # **重要**:请务必确保本接口指定的COS存储桶存在(不要手动删除COS桶)。COS存储桶一旦指定,将不能修改。 + + # @param request: Request instance for CreateCustomGroup. + # @type request: :class:`Tencentcloud::ivld::V20210903::CreateCustomGroupRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::CreateCustomGroupResponse` + def CreateCustomGroup(request) + body = send_request('CreateCustomGroup', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = CreateCustomGroupResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 创建自定义人物。 + + # 输入人物名称,基本信息,分类信息与人脸图片,创建自定义人物 + + # 人脸图片可使用图片数据(base64编码的图片数据)或者图片URL(推荐使用COS以减少下载时间,其他地址也支持),原始图片优先,也即如果同时指定了图片数据和图片URL,接口将仅使用图片数据 + + # @param request: Request instance for CreateCustomPerson. + # @type request: :class:`Tencentcloud::ivld::V20210903::CreateCustomPersonRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::CreateCustomPersonResponse` + def CreateCustomPerson(request) + body = send_request('CreateCustomPerson', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = CreateCustomPersonResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 创建默认自定义人物类型 + + # @param request: Request instance for CreateDefaultCategories. + # @type request: :class:`Tencentcloud::ivld::V20210903::CreateDefaultCategoriesRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::CreateDefaultCategoriesResponse` + def CreateDefaultCategories(request) + body = send_request('CreateDefaultCategories', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = CreateDefaultCategoriesResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 创建智能标签任务。 # 请注意,本接口为异步接口,**返回TaskId只代表任务创建成功,不代表任务执行成功**。 # @param request: Request instance for CreateTask. @@ -53,10 +192,82 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 删除自定义分类信息 + + # @param request: Request instance for DeleteCustomCategory. + # @type request: :class:`Tencentcloud::ivld::V20210903::DeleteCustomCategoryRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::DeleteCustomCategoryResponse` + def DeleteCustomCategory(request) + body = send_request('DeleteCustomCategory', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DeleteCustomCategoryResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 删除自定义人物 + + # @param request: Request instance for DeleteCustomPerson. + # @type request: :class:`Tencentcloud::ivld::V20210903::DeleteCustomPersonRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::DeleteCustomPersonResponse` + def DeleteCustomPerson(request) + body = send_request('DeleteCustomPerson', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DeleteCustomPersonResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 删除自定义人脸数据 + + # @param request: Request instance for DeleteCustomPersonImage. + # @type request: :class:`Tencentcloud::ivld::V20210903::DeleteCustomPersonImageRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::DeleteCustomPersonImageResponse` + def DeleteCustomPersonImage(request) + body = send_request('DeleteCustomPersonImage', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DeleteCustomPersonImageResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 将MediaId对应的媒资文件从系统中删除。 # **请注意,本接口仅删除媒资文件,媒资文件对应的视频分析结果不会被删除**。如您需要删除结构化分析结果,请调用DeleteTask接口。 # @param request: Request instance for DeleteMedia. @@ -79,10 +290,107 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 批量描述自定义人物分类信息 + + # @param request: Request instance for DescribeCustomCategories. + # @type request: :class:`Tencentcloud::ivld::V20210903::DescribeCustomCategoriesRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::DescribeCustomCategoriesResponse` + def DescribeCustomCategories(request) + body = send_request('DescribeCustomCategories', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DescribeCustomCategoriesResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 描述自定义人物库信息,当前库大小(库中有多少人脸),以及库中的存储桶 + + # @param request: Request instance for DescribeCustomGroup. + # @type request: :class:`Tencentcloud::ivld::V20210903::DescribeCustomGroupRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::DescribeCustomGroupResponse` + def DescribeCustomGroup(request) + body = send_request('DescribeCustomGroup', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DescribeCustomGroupResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 描述自定义人物详细信息,包括人物信息与人物信息 + + # @param request: Request instance for DescribeCustomPersonDetail. + # @type request: :class:`Tencentcloud::ivld::V20210903::DescribeCustomPersonDetailRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::DescribeCustomPersonDetailResponse` + def DescribeCustomPersonDetail(request) + body = send_request('DescribeCustomPersonDetail', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DescribeCustomPersonDetailResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 批量描述自定义人物 + + + # @param request: Request instance for DescribeCustomPersons. + # @type request: :class:`Tencentcloud::ivld::V20210903::DescribeCustomPersonsRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::DescribeCustomPersonsResponse` + def DescribeCustomPersons(request) + body = send_request('DescribeCustomPersons', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DescribeCustomPersonsResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 描述媒资文件信息,包括媒资状态,分辨率,帧率等。 # 如果媒资文件未完成导入,本接口将仅输出媒资文件的状态信息;导入完成后,本接口还将输出媒资文件的其他元信息。 # @param request: Request instance for DescribeMedia. @@ -226,9 +534,60 @@ def ImportMedia(request) body = send_request('ImportMedia', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = ImportMediaResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 更新自定义人物分类 + + # 当L2Category为空时,代表更新CategoryId对应的一级自定义人物类型以及所有二级自定义人物类型所从属的一级自定义人物类型; + # 当L2Category非空时,仅更新CategoryId对应的二级自定义人物类型 + + # @param request: Request instance for UpdateCustomCategory. + # @type request: :class:`Tencentcloud::ivld::V20210903::UpdateCustomCategoryRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::UpdateCustomCategoryResponse` + def UpdateCustomCategory(request) + body = send_request('UpdateCustomCategory', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = UpdateCustomCategoryResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 更新自定义人物信息,包括姓名,简要信息,分类信息等 + + # @param request: Request instance for UpdateCustomPerson. + # @type request: :class:`Tencentcloud::ivld::V20210903::UpdateCustomPersonRequest` + # @rtype: :class:`Tencentcloud::ivld::V20210903::UpdateCustomPersonResponse` + def UpdateCustomPerson(request) + body = send_request('UpdateCustomPerson', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = UpdateCustomPersonResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] message = response['Response']['Error']['Message'] \ No newline at end of file