tencentcloud-sdk-facefusion 1.0.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/VERSION +1 -0
- data/lib/tencentcloud-sdk-facefusion.rb +11 -0
- data/lib/v20181201/client.rb +138 -0
- data/lib/v20181201/models.rb +557 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: afac67919e1648d6265b72fc7db688b28d8ec755
|
4
|
+
data.tar.gz: 6464a65e627f6b0bfcdb9ac993b750e467dfa8d8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 943a2cf29a8e519adcac5ba76c762094727f72a476ac1874970f61a1a58fa8975e70445bb1fcb6b49f51c92907d95f3b7d6662728f889beb70bcbf76fed894df
|
7
|
+
data.tar.gz: 88791af1215875ef8fd26395d2ffd1456cc627c26dca658386735498da6fa271ac5f66d125523f13c5f048e284a3f7ca53b027ae58101b392dc50340e0f16ce8
|
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.200
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require 'json'
|
18
|
+
|
19
|
+
module TencentCloud
|
20
|
+
module Facefusion
|
21
|
+
module V20181201
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2018-12-01'
|
26
|
+
api_endpoint = 'facefusion.tencentcloudapi.com'
|
27
|
+
sdk_version = 'FACEFUSION_' + File.read(File.expand_path('../VERSION', __dir__)).strip
|
28
|
+
super(credential, region, api_version, api_endpoint, sdk_version, profile)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
# 通常通过腾讯云人脸融合的控制台可以查看到素材相关的参数数据,可以满足使用。本接口返回活动的素材数据,包括素材状态等。用于用户通过Api查看素材相关数据,方便使用。
|
33
|
+
|
34
|
+
# @param request: Request instance for DescribeMaterialList.
|
35
|
+
# @type request: :class:`Tencentcloud::facefusion::V20181201::DescribeMaterialListRequest`
|
36
|
+
# @rtype: :class:`Tencentcloud::facefusion::V20181201::DescribeMaterialListResponse`
|
37
|
+
def DescribeMaterialList(request)
|
38
|
+
body = send_request('DescribeMaterialList', request.serialize)
|
39
|
+
response = JSON.parse(body)
|
40
|
+
if response['Response'].key?('Error') == false
|
41
|
+
model = DescribeMaterialListResponse.new
|
42
|
+
model.deserialize(response['Response'])
|
43
|
+
model
|
44
|
+
else
|
45
|
+
code = response['Response']['Error']['Code']
|
46
|
+
message = response['Response']['Error']['Message']
|
47
|
+
reqid = response['Response']['RequestId']
|
48
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
49
|
+
end
|
50
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
51
|
+
raise e
|
52
|
+
rescue StandardError => e
|
53
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
54
|
+
end
|
55
|
+
|
56
|
+
# 本接口用于人脸融合,用户上传人脸图片,获取与模板融合后的人脸图片。未发布的活动请求频率限制为1次/秒,已发布的活动请求频率限制50次/秒。如有需要提高活动的请求频率限制,请在控制台中申请。
|
57
|
+
# >
|
58
|
+
# - 公共参数中的签名方式必须指定为V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
59
|
+
|
60
|
+
# @param request: Request instance for FaceFusion.
|
61
|
+
# @type request: :class:`Tencentcloud::facefusion::V20181201::FaceFusionRequest`
|
62
|
+
# @rtype: :class:`Tencentcloud::facefusion::V20181201::FaceFusionResponse`
|
63
|
+
def FaceFusion(request)
|
64
|
+
body = send_request('FaceFusion', request.serialize)
|
65
|
+
response = JSON.parse(body)
|
66
|
+
if response['Response'].key?('Error') == false
|
67
|
+
model = FaceFusionResponse.new
|
68
|
+
model.deserialize(response['Response'])
|
69
|
+
model
|
70
|
+
else
|
71
|
+
code = response['Response']['Error']['Code']
|
72
|
+
message = response['Response']['Error']['Message']
|
73
|
+
reqid = response['Response']['RequestId']
|
74
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
75
|
+
end
|
76
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
77
|
+
raise e
|
78
|
+
rescue StandardError => e
|
79
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
80
|
+
end
|
81
|
+
|
82
|
+
# 人脸融合活动专用版,不推荐使用。人脸融合接口建议使用[人脸融合](https://cloud.tencent.com/document/product/670/31061)或[选脸融合](https://cloud.tencent.com/document/product/670/37736)接口
|
83
|
+
|
84
|
+
# @param request: Request instance for FaceFusionLite.
|
85
|
+
# @type request: :class:`Tencentcloud::facefusion::V20181201::FaceFusionLiteRequest`
|
86
|
+
# @rtype: :class:`Tencentcloud::facefusion::V20181201::FaceFusionLiteResponse`
|
87
|
+
def FaceFusionLite(request)
|
88
|
+
body = send_request('FaceFusionLite', request.serialize)
|
89
|
+
response = JSON.parse(body)
|
90
|
+
if response['Response'].key?('Error') == false
|
91
|
+
model = FaceFusionLiteResponse.new
|
92
|
+
model.deserialize(response['Response'])
|
93
|
+
model
|
94
|
+
else
|
95
|
+
code = response['Response']['Error']['Code']
|
96
|
+
message = response['Response']['Error']['Message']
|
97
|
+
reqid = response['Response']['RequestId']
|
98
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
99
|
+
end
|
100
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
101
|
+
raise e
|
102
|
+
rescue StandardError => e
|
103
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
104
|
+
end
|
105
|
+
|
106
|
+
# 本接口用于单脸、多脸融合,用户上传人脸图片,获取与模板融合后的人脸图片。查看 <a href="https://cloud.tencent.com/document/product/670/38247" target="_blank">选脸融合接入指引</a>。
|
107
|
+
|
108
|
+
# 未发布的活动请求频率限制为1次/秒,已发布的活动请求频率限制50次/秒。如有需要提高活动的请求频率限制,请在控制台中申请。
|
109
|
+
# >
|
110
|
+
# - 公共参数中的签名方式必须指定为V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
|
111
|
+
|
112
|
+
# @param request: Request instance for FuseFace.
|
113
|
+
# @type request: :class:`Tencentcloud::facefusion::V20181201::FuseFaceRequest`
|
114
|
+
# @rtype: :class:`Tencentcloud::facefusion::V20181201::FuseFaceResponse`
|
115
|
+
def FuseFace(request)
|
116
|
+
body = send_request('FuseFace', request.serialize)
|
117
|
+
response = JSON.parse(body)
|
118
|
+
if response['Response'].key?('Error') == false
|
119
|
+
model = FuseFaceResponse.new
|
120
|
+
model.deserialize(response['Response'])
|
121
|
+
model
|
122
|
+
else
|
123
|
+
code = response['Response']['Error']['Code']
|
124
|
+
message = response['Response']['Error']['Message']
|
125
|
+
reqid = response['Response']['RequestId']
|
126
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
127
|
+
end
|
128
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
129
|
+
raise e
|
130
|
+
rescue StandardError => e
|
131
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
132
|
+
end
|
133
|
+
|
134
|
+
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,557 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
module TencentCloud
|
18
|
+
module Facefusion
|
19
|
+
module V20181201
|
20
|
+
# DescribeMaterialList请求参数结构体
|
21
|
+
class DescribeMaterialListRequest < TencentCloud::Common::AbstractModel
|
22
|
+
# @param ActivityId: 活动Id
|
23
|
+
# @type ActivityId: Integer
|
24
|
+
# @param MaterialId: 素材Id
|
25
|
+
# @type MaterialId: String
|
26
|
+
# @param Limit: 每次拉取条数
|
27
|
+
# @type Limit: Integer
|
28
|
+
# @param Offset: 偏移量
|
29
|
+
# @type Offset: Integer
|
30
|
+
|
31
|
+
attr_accessor :ActivityId, :MaterialId, :Limit, :Offset
|
32
|
+
|
33
|
+
def initialize(activityid=nil, materialid=nil, limit=nil, offset=nil)
|
34
|
+
@ActivityId = activityid
|
35
|
+
@MaterialId = materialid
|
36
|
+
@Limit = limit
|
37
|
+
@Offset = offset
|
38
|
+
end
|
39
|
+
|
40
|
+
def deserialize(params)
|
41
|
+
@ActivityId = params['ActivityId']
|
42
|
+
@MaterialId = params['MaterialId']
|
43
|
+
@Limit = params['Limit']
|
44
|
+
@Offset = params['Offset']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# DescribeMaterialList返回参数结构体
|
49
|
+
class DescribeMaterialListResponse < TencentCloud::Common::AbstractModel
|
50
|
+
# @param MaterialInfos: 素材列表数据
|
51
|
+
# @type MaterialInfos: Array
|
52
|
+
# @param Count: 素材条数
|
53
|
+
# @type Count: Integer
|
54
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
55
|
+
# @type RequestId: String
|
56
|
+
|
57
|
+
attr_accessor :MaterialInfos, :Count, :RequestId
|
58
|
+
|
59
|
+
def initialize(materialinfos=nil, count=nil, requestid=nil)
|
60
|
+
@MaterialInfos = materialinfos
|
61
|
+
@Count = count
|
62
|
+
@RequestId = requestid
|
63
|
+
end
|
64
|
+
|
65
|
+
def deserialize(params)
|
66
|
+
unless params['MaterialInfos'].nil?
|
67
|
+
@MaterialInfos = []
|
68
|
+
params['MaterialInfos'].each do |i|
|
69
|
+
publicmaterialinfos_tmp = PublicMaterialInfos.new
|
70
|
+
publicmaterialinfos_tmp.deserialize(i)
|
71
|
+
@MaterialInfos << publicmaterialinfos_tmp
|
72
|
+
end
|
73
|
+
end
|
74
|
+
@Count = params['Count']
|
75
|
+
@RequestId = params['RequestId']
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# FaceFusionLite请求参数结构体
|
80
|
+
class FaceFusionLiteRequest < TencentCloud::Common::AbstractModel
|
81
|
+
# @param ProjectId: 活动 ID,请在人脸融合控制台查看。
|
82
|
+
# @type ProjectId: String
|
83
|
+
# @param ModelId: 素材 ID,请在人脸融合控制台查看。
|
84
|
+
# @type ModelId: String
|
85
|
+
# @param MergeInfos: 用户人脸图片、素材模板图的人脸位置信息。
|
86
|
+
# @type MergeInfos: Array
|
87
|
+
# @param RspImgType: 返回图像方式(url 或 base64) ,二选一。默认url, url有效期为30天。
|
88
|
+
# @type RspImgType: String
|
89
|
+
# @param CelebrityIdentify: 请注意,鉴政服务开启后,您需要根据返回结果自行判断是否调整您的业务逻辑。例如提示您的用户图片非法,请更换图片。
|
90
|
+
# @type CelebrityIdentify: Integer
|
91
|
+
# @param Engine: 算法引擎参数: 1)选脸版 - youturecreat; 2)优享版 - youtu1vN; 3)畅享版 - ptu; 4)随机 - ALL; 默认为活动选择的算法
|
92
|
+
# @type Engine: String
|
93
|
+
|
94
|
+
attr_accessor :ProjectId, :ModelId, :MergeInfos, :RspImgType, :CelebrityIdentify, :Engine
|
95
|
+
|
96
|
+
def initialize(projectid=nil, modelid=nil, mergeinfos=nil, rspimgtype=nil, celebrityidentify=nil, engine=nil)
|
97
|
+
@ProjectId = projectid
|
98
|
+
@ModelId = modelid
|
99
|
+
@MergeInfos = mergeinfos
|
100
|
+
@RspImgType = rspimgtype
|
101
|
+
@CelebrityIdentify = celebrityidentify
|
102
|
+
@Engine = engine
|
103
|
+
end
|
104
|
+
|
105
|
+
def deserialize(params)
|
106
|
+
@ProjectId = params['ProjectId']
|
107
|
+
@ModelId = params['ModelId']
|
108
|
+
unless params['MergeInfos'].nil?
|
109
|
+
@MergeInfos = []
|
110
|
+
params['MergeInfos'].each do |i|
|
111
|
+
mergeinfo_tmp = MergeInfo.new
|
112
|
+
mergeinfo_tmp.deserialize(i)
|
113
|
+
@MergeInfos << mergeinfo_tmp
|
114
|
+
end
|
115
|
+
end
|
116
|
+
@RspImgType = params['RspImgType']
|
117
|
+
@CelebrityIdentify = params['CelebrityIdentify']
|
118
|
+
@Engine = params['Engine']
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# FaceFusionLite返回参数结构体
|
123
|
+
class FaceFusionLiteResponse < TencentCloud::Common::AbstractModel
|
124
|
+
# @param Image: RspImgType 为 url 时,返回结果的 url, RspImgType 为 base64 时返回 base64 数据。
|
125
|
+
# @type Image: String
|
126
|
+
# @param ReviewResultSet: 鉴政结果
|
127
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
128
|
+
# @type ReviewResultSet: Array
|
129
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
130
|
+
# @type RequestId: String
|
131
|
+
|
132
|
+
attr_accessor :Image, :ReviewResultSet, :RequestId
|
133
|
+
|
134
|
+
def initialize(image=nil, reviewresultset=nil, requestid=nil)
|
135
|
+
@Image = image
|
136
|
+
@ReviewResultSet = reviewresultset
|
137
|
+
@RequestId = requestid
|
138
|
+
end
|
139
|
+
|
140
|
+
def deserialize(params)
|
141
|
+
@Image = params['Image']
|
142
|
+
unless params['ReviewResultSet'].nil?
|
143
|
+
@ReviewResultSet = []
|
144
|
+
params['ReviewResultSet'].each do |i|
|
145
|
+
fusefacereviewresult_tmp = FuseFaceReviewResult.new
|
146
|
+
fusefacereviewresult_tmp.deserialize(i)
|
147
|
+
@ReviewResultSet << fusefacereviewresult_tmp
|
148
|
+
end
|
149
|
+
end
|
150
|
+
@RequestId = params['RequestId']
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# FaceFusion请求参数结构体
|
155
|
+
class FaceFusionRequest < TencentCloud::Common::AbstractModel
|
156
|
+
# @param ProjectId: 活动 ID,请在人脸融合控制台查看。
|
157
|
+
# @type ProjectId: String
|
158
|
+
# @param ModelId: 素材 ID,请在人脸融合控制台查看。
|
159
|
+
# @type ModelId: String
|
160
|
+
# @param RspImgType: 返回图像方式(url 或 base64) ,二选一。url有效期为7天。
|
161
|
+
# @type RspImgType: String
|
162
|
+
# @param Image: 图片 base64 数据。请确保人脸为正脸,无旋转。若某些手机拍摄后人脸被旋转,请使用图片的 EXIF 信息对图片进行旋转处理;请勿在 base64 数据中包含头部,如“data:image/jpeg;base64,”。
|
163
|
+
# @type Image: String
|
164
|
+
# @param PornDetect: 历史遗留字段,无需填写。因为融合只需提取人脸特征,不需要鉴黄。
|
165
|
+
# @type PornDetect: Integer
|
166
|
+
# @param CelebrityIdentify: 0表示不需要不适宜内容识别,1表示需要不适宜内容识别。默认值为0。
|
167
|
+
# 请注意,不适宜内容识别服务开启后,您需要根据返回结果自行判断是否调整您的业务逻辑。例如提示您的用户图片非法,请更换图片。
|
168
|
+
# @type CelebrityIdentify: Integer
|
169
|
+
# @param Url: 图片Url地址
|
170
|
+
# @type Url: String
|
171
|
+
|
172
|
+
attr_accessor :ProjectId, :ModelId, :RspImgType, :Image, :PornDetect, :CelebrityIdentify, :Url
|
173
|
+
|
174
|
+
def initialize(projectid=nil, modelid=nil, rspimgtype=nil, image=nil, porndetect=nil, celebrityidentify=nil, url=nil)
|
175
|
+
@ProjectId = projectid
|
176
|
+
@ModelId = modelid
|
177
|
+
@RspImgType = rspimgtype
|
178
|
+
@Image = image
|
179
|
+
@PornDetect = porndetect
|
180
|
+
@CelebrityIdentify = celebrityidentify
|
181
|
+
@Url = url
|
182
|
+
end
|
183
|
+
|
184
|
+
def deserialize(params)
|
185
|
+
@ProjectId = params['ProjectId']
|
186
|
+
@ModelId = params['ModelId']
|
187
|
+
@RspImgType = params['RspImgType']
|
188
|
+
@Image = params['Image']
|
189
|
+
@PornDetect = params['PornDetect']
|
190
|
+
@CelebrityIdentify = params['CelebrityIdentify']
|
191
|
+
@Url = params['Url']
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# FaceFusion返回参数结构体
|
196
|
+
class FaceFusionResponse < TencentCloud::Common::AbstractModel
|
197
|
+
# @param Image: RspImgType 为 url 时,返回结果的 url, RspImgType 为 base64 时返回 base64 数据。
|
198
|
+
# @type Image: String
|
199
|
+
# @param ReviewResultSet: 不适宜内容识别结果
|
200
|
+
# @type ReviewResultSet: Array
|
201
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
202
|
+
# @type RequestId: String
|
203
|
+
|
204
|
+
attr_accessor :Image, :ReviewResultSet, :RequestId
|
205
|
+
|
206
|
+
def initialize(image=nil, reviewresultset=nil, requestid=nil)
|
207
|
+
@Image = image
|
208
|
+
@ReviewResultSet = reviewresultset
|
209
|
+
@RequestId = requestid
|
210
|
+
end
|
211
|
+
|
212
|
+
def deserialize(params)
|
213
|
+
@Image = params['Image']
|
214
|
+
unless params['ReviewResultSet'].nil?
|
215
|
+
@ReviewResultSet = []
|
216
|
+
params['ReviewResultSet'].each do |i|
|
217
|
+
fusefacereviewresult_tmp = FuseFaceReviewResult.new
|
218
|
+
fusefacereviewresult_tmp.deserialize(i)
|
219
|
+
@ReviewResultSet << fusefacereviewresult_tmp
|
220
|
+
end
|
221
|
+
end
|
222
|
+
@RequestId = params['RequestId']
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# 人脸信息
|
227
|
+
class FaceInfo < TencentCloud::Common::AbstractModel
|
228
|
+
# @param X: 人脸框的横坐标
|
229
|
+
# @type X: Integer
|
230
|
+
# @param Y: 人脸框的纵坐标
|
231
|
+
# @type Y: Integer
|
232
|
+
# @param Width: 人脸框的宽度
|
233
|
+
# @type Width: Integer
|
234
|
+
# @param Height: 人脸框的高度
|
235
|
+
# @type Height: Integer
|
236
|
+
|
237
|
+
attr_accessor :X, :Y, :Width, :Height
|
238
|
+
|
239
|
+
def initialize(x=nil, y=nil, width=nil, height=nil)
|
240
|
+
@X = x
|
241
|
+
@Y = y
|
242
|
+
@Width = width
|
243
|
+
@Height = height
|
244
|
+
end
|
245
|
+
|
246
|
+
def deserialize(params)
|
247
|
+
@X = params['X']
|
248
|
+
@Y = params['Y']
|
249
|
+
@Width = params['Width']
|
250
|
+
@Height = params['Height']
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
# 人脸框信息
|
255
|
+
class FaceRect < TencentCloud::Common::AbstractModel
|
256
|
+
# @param X: 人脸框左上角横坐标。
|
257
|
+
# @type X: Integer
|
258
|
+
# @param Y: 人脸框左上角纵坐标。
|
259
|
+
# @type Y: Integer
|
260
|
+
# @param Width: 人脸框宽度。
|
261
|
+
# @type Width: Integer
|
262
|
+
# @param Height: 人脸框高度。
|
263
|
+
# @type Height: Integer
|
264
|
+
|
265
|
+
attr_accessor :X, :Y, :Width, :Height
|
266
|
+
|
267
|
+
def initialize(x=nil, y=nil, width=nil, height=nil)
|
268
|
+
@X = x
|
269
|
+
@Y = y
|
270
|
+
@Width = width
|
271
|
+
@Height = height
|
272
|
+
end
|
273
|
+
|
274
|
+
def deserialize(params)
|
275
|
+
@X = params['X']
|
276
|
+
@Y = params['Y']
|
277
|
+
@Width = params['Width']
|
278
|
+
@Height = params['Height']
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
# FuseFace请求参数结构体
|
283
|
+
class FuseFaceRequest < TencentCloud::Common::AbstractModel
|
284
|
+
# @param ProjectId: 活动 ID,请在人脸融合控制台查看。
|
285
|
+
# @type ProjectId: String
|
286
|
+
# @param ModelId: 素材 ID,请在人脸融合控制台查看。
|
287
|
+
# @type ModelId: String
|
288
|
+
# @param RspImgType: 返回图像方式(url 或 base64) ,二选一。url有效期为7天。
|
289
|
+
# @type RspImgType: String
|
290
|
+
# @param MergeInfos: 用户人脸图片、素材模板图的人脸位置信息。
|
291
|
+
# @type MergeInfos: Array
|
292
|
+
# @param FuseProfileDegree: 脸型融合比例,数值越高,融合后的脸型越像素材人物。取值范围[0,100]
|
293
|
+
# 若此参数不填写,则使用人脸融合控制台中脸型参数数值。(换脸版算法暂不支持此参数调整)
|
294
|
+
# @type FuseProfileDegree: Integer
|
295
|
+
# @param FuseFaceDegree: 五官融合比例,数值越高,融合后的五官越像素材人物。取值范围[0,100]
|
296
|
+
# 若此参数不填写,则使用人脸融合控制台中五官参数数值。(换脸版算法暂不支持此参数调整)
|
297
|
+
# @type FuseFaceDegree: Integer
|
298
|
+
# @param CelebrityIdentify: 0表示不需要不适宜内容识别,1表示需要不适宜内容识别。默认值为0。
|
299
|
+
# 请注意,不适宜内容识别服务开启后,您需要根据返回结果自行判断是否调整您的业务逻辑。例如提示您的用户图片非法,请更换图片。
|
300
|
+
# @type CelebrityIdentify: Integer
|
301
|
+
|
302
|
+
attr_accessor :ProjectId, :ModelId, :RspImgType, :MergeInfos, :FuseProfileDegree, :FuseFaceDegree, :CelebrityIdentify
|
303
|
+
|
304
|
+
def initialize(projectid=nil, modelid=nil, rspimgtype=nil, mergeinfos=nil, fuseprofiledegree=nil, fusefacedegree=nil, celebrityidentify=nil)
|
305
|
+
@ProjectId = projectid
|
306
|
+
@ModelId = modelid
|
307
|
+
@RspImgType = rspimgtype
|
308
|
+
@MergeInfos = mergeinfos
|
309
|
+
@FuseProfileDegree = fuseprofiledegree
|
310
|
+
@FuseFaceDegree = fusefacedegree
|
311
|
+
@CelebrityIdentify = celebrityidentify
|
312
|
+
end
|
313
|
+
|
314
|
+
def deserialize(params)
|
315
|
+
@ProjectId = params['ProjectId']
|
316
|
+
@ModelId = params['ModelId']
|
317
|
+
@RspImgType = params['RspImgType']
|
318
|
+
unless params['MergeInfos'].nil?
|
319
|
+
@MergeInfos = []
|
320
|
+
params['MergeInfos'].each do |i|
|
321
|
+
mergeinfo_tmp = MergeInfo.new
|
322
|
+
mergeinfo_tmp.deserialize(i)
|
323
|
+
@MergeInfos << mergeinfo_tmp
|
324
|
+
end
|
325
|
+
end
|
326
|
+
@FuseProfileDegree = params['FuseProfileDegree']
|
327
|
+
@FuseFaceDegree = params['FuseFaceDegree']
|
328
|
+
@CelebrityIdentify = params['CelebrityIdentify']
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
# FuseFace返回参数结构体
|
333
|
+
class FuseFaceResponse < TencentCloud::Common::AbstractModel
|
334
|
+
# @param FusedImage: RspImgType 为 url 时,返回结果的 url, RspImgType 为 base64 时返回 base64 数据。
|
335
|
+
# @type FusedImage: String
|
336
|
+
# @param ReviewResultSet: 不适宜内容识别结果。该数组的顺序和请求中mergeinfo的顺序一致,一一对应
|
337
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
338
|
+
# @type ReviewResultSet: Array
|
339
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
340
|
+
# @type RequestId: String
|
341
|
+
|
342
|
+
attr_accessor :FusedImage, :ReviewResultSet, :RequestId
|
343
|
+
|
344
|
+
def initialize(fusedimage=nil, reviewresultset=nil, requestid=nil)
|
345
|
+
@FusedImage = fusedimage
|
346
|
+
@ReviewResultSet = reviewresultset
|
347
|
+
@RequestId = requestid
|
348
|
+
end
|
349
|
+
|
350
|
+
def deserialize(params)
|
351
|
+
@FusedImage = params['FusedImage']
|
352
|
+
unless params['ReviewResultSet'].nil?
|
353
|
+
@ReviewResultSet = []
|
354
|
+
params['ReviewResultSet'].each do |i|
|
355
|
+
fusefacereviewresult_tmp = FuseFaceReviewResult.new
|
356
|
+
fusefacereviewresult_tmp.deserialize(i)
|
357
|
+
@ReviewResultSet << fusefacereviewresult_tmp
|
358
|
+
end
|
359
|
+
end
|
360
|
+
@RequestId = params['RequestId']
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
# 人脸融合不适宜内容识别人脸信息
|
365
|
+
class FuseFaceReviewDetail < TencentCloud::Common::AbstractModel
|
366
|
+
# @param Field: 保留字段
|
367
|
+
# @type Field: String
|
368
|
+
# @param Label: 人员名称
|
369
|
+
# @type Label: String
|
370
|
+
# @param Confidence: 对应识别label的置信度,分数越高意味涉政可能性越大。
|
371
|
+
# 0到70,Suggestion建议为PASS;
|
372
|
+
# 70到80,Suggestion建议为REVIEW;
|
373
|
+
# 80到100,Suggestion建议为BLOCK。
|
374
|
+
# @type Confidence: Float
|
375
|
+
# @param Suggestion: 识别场景的审核结论:
|
376
|
+
# PASS:正常
|
377
|
+
# REVIEW:疑似
|
378
|
+
# BLOCK:违规
|
379
|
+
# @type Suggestion: String
|
380
|
+
|
381
|
+
attr_accessor :Field, :Label, :Confidence, :Suggestion
|
382
|
+
|
383
|
+
def initialize(field=nil, label=nil, confidence=nil, suggestion=nil)
|
384
|
+
@Field = field
|
385
|
+
@Label = label
|
386
|
+
@Confidence = confidence
|
387
|
+
@Suggestion = suggestion
|
388
|
+
end
|
389
|
+
|
390
|
+
def deserialize(params)
|
391
|
+
@Field = params['Field']
|
392
|
+
@Label = params['Label']
|
393
|
+
@Confidence = params['Confidence']
|
394
|
+
@Suggestion = params['Suggestion']
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
# 人脸融合不适宜内容识别返回参数item
|
399
|
+
class FuseFaceReviewResult < TencentCloud::Common::AbstractModel
|
400
|
+
# @param Category: 保留字段
|
401
|
+
# @type Category: String
|
402
|
+
# @param Code: 状态码, 0为处理成功,其他值为处理失败
|
403
|
+
# @type Code: String
|
404
|
+
# @param CodeDescription: 对应状态码信息描述
|
405
|
+
# @type CodeDescription: String
|
406
|
+
# @param Confidence: 保留字段
|
407
|
+
# @type Confidence: Float
|
408
|
+
# @param Suggestion: 保留字段
|
409
|
+
# @type Suggestion: String
|
410
|
+
# @param DetailSet: 审核详细内容
|
411
|
+
# @type DetailSet: Array
|
412
|
+
|
413
|
+
attr_accessor :Category, :Code, :CodeDescription, :Confidence, :Suggestion, :DetailSet
|
414
|
+
|
415
|
+
def initialize(category=nil, code=nil, codedescription=nil, confidence=nil, suggestion=nil, detailset=nil)
|
416
|
+
@Category = category
|
417
|
+
@Code = code
|
418
|
+
@CodeDescription = codedescription
|
419
|
+
@Confidence = confidence
|
420
|
+
@Suggestion = suggestion
|
421
|
+
@DetailSet = detailset
|
422
|
+
end
|
423
|
+
|
424
|
+
def deserialize(params)
|
425
|
+
@Category = params['Category']
|
426
|
+
@Code = params['Code']
|
427
|
+
@CodeDescription = params['CodeDescription']
|
428
|
+
@Confidence = params['Confidence']
|
429
|
+
@Suggestion = params['Suggestion']
|
430
|
+
unless params['DetailSet'].nil?
|
431
|
+
@DetailSet = []
|
432
|
+
params['DetailSet'].each do |i|
|
433
|
+
fusefacereviewdetail_tmp = FuseFaceReviewDetail.new
|
434
|
+
fusefacereviewdetail_tmp.deserialize(i)
|
435
|
+
@DetailSet << fusefacereviewdetail_tmp
|
436
|
+
end
|
437
|
+
end
|
438
|
+
end
|
439
|
+
end
|
440
|
+
|
441
|
+
# 人脸信息
|
442
|
+
class MaterialFaceList < TencentCloud::Common::AbstractModel
|
443
|
+
# @param FaceId: 人脸序号
|
444
|
+
# @type FaceId: String
|
445
|
+
# @param FaceInfo: 人脸框信息
|
446
|
+
# @type FaceInfo: :class:`Tencentcloud::Facefusion.v20181201.models.FaceInfo`
|
447
|
+
|
448
|
+
attr_accessor :FaceId, :FaceInfo
|
449
|
+
|
450
|
+
def initialize(faceid=nil, faceinfo=nil)
|
451
|
+
@FaceId = faceid
|
452
|
+
@FaceInfo = faceinfo
|
453
|
+
end
|
454
|
+
|
455
|
+
def deserialize(params)
|
456
|
+
@FaceId = params['FaceId']
|
457
|
+
unless params['FaceInfo'].nil?
|
458
|
+
@FaceInfo = FaceInfo.new
|
459
|
+
@FaceInfo.deserialize(params['FaceInfo'])
|
460
|
+
end
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
# 人脸图片和待被融合的素材模板图的人脸位置信息。
|
465
|
+
class MergeInfo < TencentCloud::Common::AbstractModel
|
466
|
+
# @param Image: 输入图片base64
|
467
|
+
# @type Image: String
|
468
|
+
# @param Url: 输入图片url
|
469
|
+
# @type Url: String
|
470
|
+
# @param InputImageFaceRect: 上传的图片人脸位置信息(人脸框)
|
471
|
+
# @type InputImageFaceRect: :class:`Tencentcloud::Facefusion.v20181201.models.FaceRect`
|
472
|
+
# @param TemplateFaceID: 控制台上传的素材人脸ID
|
473
|
+
# @type TemplateFaceID: String
|
474
|
+
|
475
|
+
attr_accessor :Image, :Url, :InputImageFaceRect, :TemplateFaceID
|
476
|
+
|
477
|
+
def initialize(image=nil, url=nil, inputimagefacerect=nil, templatefaceid=nil)
|
478
|
+
@Image = image
|
479
|
+
@Url = url
|
480
|
+
@InputImageFaceRect = inputimagefacerect
|
481
|
+
@TemplateFaceID = templatefaceid
|
482
|
+
end
|
483
|
+
|
484
|
+
def deserialize(params)
|
485
|
+
@Image = params['Image']
|
486
|
+
@Url = params['Url']
|
487
|
+
unless params['InputImageFaceRect'].nil?
|
488
|
+
@InputImageFaceRect = FaceRect.new
|
489
|
+
@InputImageFaceRect.deserialize(params['InputImageFaceRect'])
|
490
|
+
end
|
491
|
+
@TemplateFaceID = params['TemplateFaceID']
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
495
|
+
# 素材信息
|
496
|
+
class PublicMaterialInfos < TencentCloud::Common::AbstractModel
|
497
|
+
# @param MaterialId: 素材Id
|
498
|
+
# @type MaterialId: String
|
499
|
+
# @param MaterialStatus: 素材状态
|
500
|
+
# @type MaterialStatus: Integer
|
501
|
+
# @param BlendParamPtu: 脸型参数P图
|
502
|
+
# @type BlendParamPtu: Integer
|
503
|
+
# @param PositionParamPtu: 五官参数P图
|
504
|
+
# @type PositionParamPtu: Integer
|
505
|
+
# @param BlendParamYoutu: 脸型参数优图
|
506
|
+
# @type BlendParamYoutu: Integer
|
507
|
+
# @param PositionParamYoutu: 五官参数优图
|
508
|
+
# @type PositionParamYoutu: Integer
|
509
|
+
# @param Url: 素材COS地址
|
510
|
+
# @type Url: String
|
511
|
+
# @param CreateTime: 创建时间
|
512
|
+
# @type CreateTime: String
|
513
|
+
# @param UpdateTime: 修改时间
|
514
|
+
# @type UpdateTime: String
|
515
|
+
# @param MaterialFaceList: 人脸信息
|
516
|
+
# @type MaterialFaceList: Array
|
517
|
+
|
518
|
+
attr_accessor :MaterialId, :MaterialStatus, :BlendParamPtu, :PositionParamPtu, :BlendParamYoutu, :PositionParamYoutu, :Url, :CreateTime, :UpdateTime, :MaterialFaceList
|
519
|
+
|
520
|
+
def initialize(materialid=nil, materialstatus=nil, blendparamptu=nil, positionparamptu=nil, blendparamyoutu=nil, positionparamyoutu=nil, url=nil, createtime=nil, updatetime=nil, materialfacelist=nil)
|
521
|
+
@MaterialId = materialid
|
522
|
+
@MaterialStatus = materialstatus
|
523
|
+
@BlendParamPtu = blendparamptu
|
524
|
+
@PositionParamPtu = positionparamptu
|
525
|
+
@BlendParamYoutu = blendparamyoutu
|
526
|
+
@PositionParamYoutu = positionparamyoutu
|
527
|
+
@Url = url
|
528
|
+
@CreateTime = createtime
|
529
|
+
@UpdateTime = updatetime
|
530
|
+
@MaterialFaceList = materialfacelist
|
531
|
+
end
|
532
|
+
|
533
|
+
def deserialize(params)
|
534
|
+
@MaterialId = params['MaterialId']
|
535
|
+
@MaterialStatus = params['MaterialStatus']
|
536
|
+
@BlendParamPtu = params['BlendParamPtu']
|
537
|
+
@PositionParamPtu = params['PositionParamPtu']
|
538
|
+
@BlendParamYoutu = params['BlendParamYoutu']
|
539
|
+
@PositionParamYoutu = params['PositionParamYoutu']
|
540
|
+
@Url = params['Url']
|
541
|
+
@CreateTime = params['CreateTime']
|
542
|
+
@UpdateTime = params['UpdateTime']
|
543
|
+
unless params['MaterialFaceList'].nil?
|
544
|
+
@MaterialFaceList = []
|
545
|
+
params['MaterialFaceList'].each do |i|
|
546
|
+
materialfacelist_tmp = MaterialFaceList.new
|
547
|
+
materialfacelist_tmp.deserialize(i)
|
548
|
+
@MaterialFaceList << materialfacelist_tmp
|
549
|
+
end
|
550
|
+
end
|
551
|
+
end
|
552
|
+
end
|
553
|
+
|
554
|
+
end
|
555
|
+
end
|
556
|
+
end
|
557
|
+
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tencentcloud-sdk-facefusion
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.200
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tencent Cloud
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tencentcloud-sdk-common
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
description: Tencent Cloud Ruby SDK is the official software development kit, which
|
28
|
+
allows Ruby developers to write software that makes use of Tencent Cloud service
|
29
|
+
FACEFUSION.
|
30
|
+
email:
|
31
|
+
- tencentcloudapi@tencent.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/VERSION
|
37
|
+
- lib/tencentcloud-sdk-facefusion.rb
|
38
|
+
- lib/v20181201/client.rb
|
39
|
+
- lib/v20181201/models.rb
|
40
|
+
homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby
|
41
|
+
licenses:
|
42
|
+
- Apache-2.0
|
43
|
+
metadata:
|
44
|
+
source_code_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/tencentcloud-sdk-facefusion
|
45
|
+
changelog_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/blob/master/CHANGELOG.md
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
requirements: []
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 2.6.14
|
63
|
+
signing_key:
|
64
|
+
specification_version: 4
|
65
|
+
summary: Tencent Cloud SDK for Ruby - FACEFUSION
|
66
|
+
test_files: []
|