tencentcloud-sdk-facefusion 3.0.489 → 3.0.491

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f9ba21cc7b3549a6a449a4ab5514b517bd6b689
4
- data.tar.gz: 3394243a3869e2b9fc0e3b65f06b26d869c58b2f
3
+ metadata.gz: 2fdad5ec12d59585c5b075ffec7ee9a8495a17f0
4
+ data.tar.gz: ae1d90e1c65239deac46a9a7322fcf5a68672416
5
5
  SHA512:
6
- metadata.gz: f63e920cd78b3020efde0a1edf9278471c42c8890e7983acb3c83744f6b772456e3702233b2b025ecbad599567aff95b88083ed6c3945094c1a72eade01a87d9
7
- data.tar.gz: 2ff9bd6817fd428e259d2fbdfc03ebf8f68fe9692b7779b8451908c41f011c6169ac302b984fb4970ad830a6b480fef323bf0aaa7132ffa32a4becc4477a875a
6
+ metadata.gz: 5c34a9962394cc36ef5ab68a407e22cf7542b4fb2102bfa85cee73d9dd2916252c83cb33bbbecff46dc4a046c17f979e579e8897e95b180bd1e0ce18e61faded
7
+ data.tar.gz: b35531f4e333e01808473226ab387df7b267c0527a09fd92bb194b4c303dd79a50a2be6bd45639fe947475c78d34a4ec60fef561a12786ad1a22e51265b4303c
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.489
1
+ 3.0.491
@@ -5,6 +5,9 @@ require 'tencentcloud-sdk-common'
5
5
  require_relative 'v20181201/client'
6
6
  require_relative 'v20181201/models'
7
7
 
8
+ require_relative 'v20220927/client'
9
+ require_relative 'v20220927/models'
10
+
8
11
  module TencentCloud
9
12
  module Facefusion
10
13
  end
@@ -0,0 +1,88 @@
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 V20220927
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2022-09-27'
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::V20220927::DescribeMaterialListRequest`
36
+ # @rtype: :class:`Tencentcloud::facefusion::V20220927::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
+ # 本接口用于单脸、多脸、选脸融合,上传人脸图片,得到与素材模板融合后的人脸图片。支持为融合结果图添加标识。查看 <a href="https://cloud.tencent.com/document/product/670/38247" target="_blank">融合接入指引</a>。
57
+
58
+ # 请求频率限制为20次/秒。
59
+ # >
60
+ # - 公共参数中的签名方式必须指定为V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
61
+
62
+ # @param request: Request instance for FuseFace.
63
+ # @type request: :class:`Tencentcloud::facefusion::V20220927::FuseFaceRequest`
64
+ # @rtype: :class:`Tencentcloud::facefusion::V20220927::FuseFaceResponse`
65
+ def FuseFace(request)
66
+ body = send_request('FuseFace', request.serialize)
67
+ response = JSON.parse(body)
68
+ if response['Response'].key?('Error') == false
69
+ model = FuseFaceResponse.new
70
+ model.deserialize(response['Response'])
71
+ model
72
+ else
73
+ code = response['Response']['Error']['Code']
74
+ message = response['Response']['Error']['Message']
75
+ reqid = response['Response']['RequestId']
76
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
77
+ end
78
+ rescue TencentCloud::Common::TencentCloudSDKException => e
79
+ raise e
80
+ rescue StandardError => e
81
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
82
+ end
83
+
84
+
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,343 @@
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 V20220927
20
+ # DescribeMaterialList请求参数结构体
21
+ class DescribeMaterialListRequest < TencentCloud::Common::AbstractModel
22
+ # @param ActivityId: 活动Id
23
+ # @type ActivityId: String
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
+ # 人脸信息
80
+ class FaceInfo < TencentCloud::Common::AbstractModel
81
+ # @param X: 人脸框的横坐标
82
+ # @type X: Integer
83
+ # @param Y: 人脸框的纵坐标
84
+ # @type Y: Integer
85
+ # @param Width: 人脸框的宽度
86
+ # @type Width: Integer
87
+ # @param Height: 人脸框的高度
88
+ # @type Height: Integer
89
+
90
+ attr_accessor :X, :Y, :Width, :Height
91
+
92
+ def initialize(x=nil, y=nil, width=nil, height=nil)
93
+ @X = x
94
+ @Y = y
95
+ @Width = width
96
+ @Height = height
97
+ end
98
+
99
+ def deserialize(params)
100
+ @X = params['X']
101
+ @Y = params['Y']
102
+ @Width = params['Width']
103
+ @Height = params['Height']
104
+ end
105
+ end
106
+
107
+ # 人脸框信息
108
+ class FaceRect < TencentCloud::Common::AbstractModel
109
+ # @param X: 人脸框左上角横坐标。
110
+ # @type X: Integer
111
+ # @param Y: 人脸框左上角纵坐标。
112
+ # @type Y: Integer
113
+ # @param Width: 人脸框宽度。
114
+ # @type Width: Integer
115
+ # @param Height: 人脸框高度。
116
+ # @type Height: Integer
117
+
118
+ attr_accessor :X, :Y, :Width, :Height
119
+
120
+ def initialize(x=nil, y=nil, width=nil, height=nil)
121
+ @X = x
122
+ @Y = y
123
+ @Width = width
124
+ @Height = height
125
+ end
126
+
127
+ def deserialize(params)
128
+ @X = params['X']
129
+ @Y = params['Y']
130
+ @Width = params['Width']
131
+ @Height = params['Height']
132
+ end
133
+ end
134
+
135
+ # FuseFace请求参数结构体
136
+ class FuseFaceRequest < TencentCloud::Common::AbstractModel
137
+ # @param ProjectId: 活动 ID,请在人脸融合控制台查看。
138
+ # @type ProjectId: String
139
+ # @param ModelId: 素材 ID,请在人脸融合控制台查看。
140
+ # @type ModelId: String
141
+ # @param RspImgType: 返回图像方式(url 或 base64) ,二选一。url有效期为7天。
142
+ # @type RspImgType: String
143
+ # @param MergeInfos: 用户人脸图片、素材模板图的人脸位置信息。
144
+ # @type MergeInfos: Array
145
+ # @param FuseProfileDegree: 脸型融合比例,数值越高,融合后的脸型越像素材人物。取值范围[0,100]
146
+ # 若此参数不填写,则使用人脸融合控制台中脸型参数数值。(换脸版算法暂不支持此参数调整)
147
+ # @type FuseProfileDegree: Integer
148
+ # @param FuseFaceDegree: 五官融合比例,数值越高,融合后的五官越像素材人物。取值范围[0,100]
149
+ # 若此参数不填写,则使用人脸融合控制台中五官参数数值。(换脸版算法暂不支持此参数调整)
150
+ # @type FuseFaceDegree: Integer
151
+ # @param LogoAdd: 为融合结果图添加合成标识的开关,默认为1。
152
+ # 1:添加标识。
153
+ # 0:不添加标识。
154
+ # 其他数值:默认按1处理。
155
+ # 建议您使用显著标识来提示结果图使用了人脸融合技术,是AI合成的图片。
156
+ # @type LogoAdd: Integer
157
+ # @param LogoParam: 标识内容设置。
158
+ # 默认在融合结果图右下角添加“本图片为AI合成图片”字样,您可根据自身需要替换为其他的Logo图片。
159
+ # @type LogoParam: :class:`Tencentcloud::Facefusion.v20220927.models.LogoParam`
160
+
161
+ attr_accessor :ProjectId, :ModelId, :RspImgType, :MergeInfos, :FuseProfileDegree, :FuseFaceDegree, :LogoAdd, :LogoParam
162
+
163
+ def initialize(projectid=nil, modelid=nil, rspimgtype=nil, mergeinfos=nil, fuseprofiledegree=nil, fusefacedegree=nil, logoadd=nil, logoparam=nil)
164
+ @ProjectId = projectid
165
+ @ModelId = modelid
166
+ @RspImgType = rspimgtype
167
+ @MergeInfos = mergeinfos
168
+ @FuseProfileDegree = fuseprofiledegree
169
+ @FuseFaceDegree = fusefacedegree
170
+ @LogoAdd = logoadd
171
+ @LogoParam = logoparam
172
+ end
173
+
174
+ def deserialize(params)
175
+ @ProjectId = params['ProjectId']
176
+ @ModelId = params['ModelId']
177
+ @RspImgType = params['RspImgType']
178
+ unless params['MergeInfos'].nil?
179
+ @MergeInfos = []
180
+ params['MergeInfos'].each do |i|
181
+ mergeinfo_tmp = MergeInfo.new
182
+ mergeinfo_tmp.deserialize(i)
183
+ @MergeInfos << mergeinfo_tmp
184
+ end
185
+ end
186
+ @FuseProfileDegree = params['FuseProfileDegree']
187
+ @FuseFaceDegree = params['FuseFaceDegree']
188
+ @LogoAdd = params['LogoAdd']
189
+ unless params['LogoParam'].nil?
190
+ @LogoParam = LogoParam.new
191
+ @LogoParam.deserialize(params['LogoParam'])
192
+ end
193
+ end
194
+ end
195
+
196
+ # FuseFace返回参数结构体
197
+ class FuseFaceResponse < TencentCloud::Common::AbstractModel
198
+ # @param FusedImage: RspImgType 为 url 时,返回结果的 url, RspImgType 为 base64 时返回 base64 数据。
199
+ # @type FusedImage: String
200
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
201
+ # @type RequestId: String
202
+
203
+ attr_accessor :FusedImage, :RequestId
204
+
205
+ def initialize(fusedimage=nil, requestid=nil)
206
+ @FusedImage = fusedimage
207
+ @RequestId = requestid
208
+ end
209
+
210
+ def deserialize(params)
211
+ @FusedImage = params['FusedImage']
212
+ @RequestId = params['RequestId']
213
+ end
214
+ end
215
+
216
+ # logo参数
217
+ class LogoParam < TencentCloud::Common::AbstractModel
218
+ # @param LogoRect: 标识图片位于融合结果图中的坐标,将按照坐标对标识图片进行位置和大小的拉伸匹配
219
+ # @type LogoRect: :class:`Tencentcloud::Facefusion.v20220927.models.FaceRect`
220
+ # @param LogoUrl: 标识图片Url地址
221
+ # @type LogoUrl: String
222
+ # @param LogoImage: 标识图片base64
223
+ # @type LogoImage: String
224
+
225
+ attr_accessor :LogoRect, :LogoUrl, :LogoImage
226
+
227
+ def initialize(logorect=nil, logourl=nil, logoimage=nil)
228
+ @LogoRect = logorect
229
+ @LogoUrl = logourl
230
+ @LogoImage = logoimage
231
+ end
232
+
233
+ def deserialize(params)
234
+ unless params['LogoRect'].nil?
235
+ @LogoRect = FaceRect.new
236
+ @LogoRect.deserialize(params['LogoRect'])
237
+ end
238
+ @LogoUrl = params['LogoUrl']
239
+ @LogoImage = params['LogoImage']
240
+ end
241
+ end
242
+
243
+ # 人脸信息
244
+ class MaterialFaces < TencentCloud::Common::AbstractModel
245
+ # @param FaceId: 人脸序号
246
+ # @type FaceId: String
247
+ # @param FaceInfo: 人脸框信息
248
+ # @type FaceInfo: :class:`Tencentcloud::Facefusion.v20220927.models.FaceInfo`
249
+
250
+ attr_accessor :FaceId, :FaceInfo
251
+
252
+ def initialize(faceid=nil, faceinfo=nil)
253
+ @FaceId = faceid
254
+ @FaceInfo = faceinfo
255
+ end
256
+
257
+ def deserialize(params)
258
+ @FaceId = params['FaceId']
259
+ unless params['FaceInfo'].nil?
260
+ @FaceInfo = FaceInfo.new
261
+ @FaceInfo.deserialize(params['FaceInfo'])
262
+ end
263
+ end
264
+ end
265
+
266
+ # 人脸图片和待被融合的素材模板图的人脸位置信息。
267
+ class MergeInfo < TencentCloud::Common::AbstractModel
268
+ # @param Image: 输入图片base64
269
+ # @type Image: String
270
+ # @param Url: 输入图片url
271
+ # @type Url: String
272
+ # @param InputImageFaceRect: 上传的图片人脸位置信息(人脸框)
273
+ # @type InputImageFaceRect: :class:`Tencentcloud::Facefusion.v20220927.models.FaceRect`
274
+ # @param TemplateFaceID: 控制台上传的素材人脸ID,不填默认取最大人脸
275
+ # @type TemplateFaceID: String
276
+
277
+ attr_accessor :Image, :Url, :InputImageFaceRect, :TemplateFaceID
278
+
279
+ def initialize(image=nil, url=nil, inputimagefacerect=nil, templatefaceid=nil)
280
+ @Image = image
281
+ @Url = url
282
+ @InputImageFaceRect = inputimagefacerect
283
+ @TemplateFaceID = templatefaceid
284
+ end
285
+
286
+ def deserialize(params)
287
+ @Image = params['Image']
288
+ @Url = params['Url']
289
+ unless params['InputImageFaceRect'].nil?
290
+ @InputImageFaceRect = FaceRect.new
291
+ @InputImageFaceRect.deserialize(params['InputImageFaceRect'])
292
+ end
293
+ @TemplateFaceID = params['TemplateFaceID']
294
+ end
295
+ end
296
+
297
+ # 素材信息
298
+ class PublicMaterialInfos < TencentCloud::Common::AbstractModel
299
+ # @param MaterialId: 素材Id
300
+ # @type MaterialId: String
301
+ # @param MaterialStatus: 素材状态
302
+ # @type MaterialStatus: Integer
303
+ # @param CreateTime: 创建时间
304
+ # @type CreateTime: String
305
+ # @param UpdateTime: 修改时间
306
+ # @type UpdateTime: String
307
+ # @param MaterialFaceList: 人脸信息
308
+ # @type MaterialFaceList: Array
309
+ # @param MaterialName: 素材名
310
+ # @type MaterialName: String
311
+
312
+ attr_accessor :MaterialId, :MaterialStatus, :CreateTime, :UpdateTime, :MaterialFaceList, :MaterialName
313
+
314
+ def initialize(materialid=nil, materialstatus=nil, createtime=nil, updatetime=nil, materialfacelist=nil, materialname=nil)
315
+ @MaterialId = materialid
316
+ @MaterialStatus = materialstatus
317
+ @CreateTime = createtime
318
+ @UpdateTime = updatetime
319
+ @MaterialFaceList = materialfacelist
320
+ @MaterialName = materialname
321
+ end
322
+
323
+ def deserialize(params)
324
+ @MaterialId = params['MaterialId']
325
+ @MaterialStatus = params['MaterialStatus']
326
+ @CreateTime = params['CreateTime']
327
+ @UpdateTime = params['UpdateTime']
328
+ unless params['MaterialFaceList'].nil?
329
+ @MaterialFaceList = []
330
+ params['MaterialFaceList'].each do |i|
331
+ materialfaces_tmp = MaterialFaces.new
332
+ materialfaces_tmp.deserialize(i)
333
+ @MaterialFaceList << materialfaces_tmp
334
+ end
335
+ end
336
+ @MaterialName = params['MaterialName']
337
+ end
338
+ end
339
+
340
+ end
341
+ end
342
+ end
343
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-facefusion
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.489
4
+ version: 3.0.491
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-09 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common
@@ -35,6 +35,8 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - lib/v20181201/client.rb
37
37
  - lib/v20181201/models.rb
38
+ - lib/v20220927/client.rb
39
+ - lib/v20220927/models.rb
38
40
  - lib/tencentcloud-sdk-facefusion.rb
39
41
  - lib/VERSION
40
42
  homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby