tencentcloud-sdk-iir 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-iir.rb +11 -0
- data/lib/v20200417/client.rb +64 -0
- data/lib/v20200417/models.rb +193 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 17a0787fcb63350c6b1fa2b3c5270a743fe8cba6
|
4
|
+
data.tar.gz: 830d14058b11147783d5020b5893c49f9ea2f58f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ec00db8e79fe7162c1e4430f550243ae76475c0560eb34936419c4f374de9ee1052a7dc9a2793032af07efbbca18a7db613498c8c9abc0490909a0ba34a8c7f3
|
7
|
+
data.tar.gz: b346d2e2ca03445c4753c6fe008b0a163ceac54811b8c334ea27f8fa1f6815dacd5315f2bbd2a9ef91c1b031e9ea374953f23a0fa0b173dff87a32ded15fe294
|
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.200
|
@@ -0,0 +1,64 @@
|
|
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 Iir
|
21
|
+
module V20200417
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2020-04-17'
|
26
|
+
api_endpoint = 'iir.tencentcloudapi.com'
|
27
|
+
sdk_version = 'IIR_' + File.read(File.expand_path('../VERSION', __dir__)).strip
|
28
|
+
super(credential, region, api_version, api_endpoint, sdk_version, profile)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
# 商品识别,使用微信扫一扫识物同款技术,基于人工智能技术、海量训练图片、亿级商品库,可以实现全覆盖、细粒度、高准确率的商品识别和商品推荐功能。 本服务可以识别出图片中的主体位置、主体商品类型,覆盖亿级SKU,输出具体商品的价格、型号等详细信息。 客户无需自建商品库,即可快速实现商品识别、拍照搜商品等功能。
|
33
|
+
|
34
|
+
# 目前“商品识别”为公测服务,需要申请、开通后方可使用。请在[服务开通申请表](https://cloud.tencent.com/apply/p/y1q2mnf0vdl) 中填写详细信息和需求,如果通过审核,我们将会在2个工作日内与您联系,并开通服务。 公测期间,本服务免费提供最高2QPS,收费模式和标准会在正式版上线前通过站内信、短信通知客户。如果需要提升并发,请与我们联系洽谈。
|
35
|
+
|
36
|
+
# 注意:本文档为公测版本,仅适用于功能体验和测试,正式业务接入请等待正式版。正式版的输入、输出可能会与公测版存在少量差异。
|
37
|
+
|
38
|
+
# @param request: Request instance for RecognizeProduct.
|
39
|
+
# @type request: :class:`Tencentcloud::iir::V20200417::RecognizeProductRequest`
|
40
|
+
# @rtype: :class:`Tencentcloud::iir::V20200417::RecognizeProductResponse`
|
41
|
+
def RecognizeProduct(request)
|
42
|
+
body = send_request('RecognizeProduct', request.serialize)
|
43
|
+
response = JSON.parse(body)
|
44
|
+
if response['Response'].key?('Error') == false
|
45
|
+
model = RecognizeProductResponse.new
|
46
|
+
model.deserialize(response['Response'])
|
47
|
+
model
|
48
|
+
else
|
49
|
+
code = response['Response']['Error']['Code']
|
50
|
+
message = response['Response']['Error']['Message']
|
51
|
+
reqid = response['Response']['RequestId']
|
52
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
53
|
+
end
|
54
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
55
|
+
raise e
|
56
|
+
rescue StandardError => e
|
57
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,193 @@
|
|
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 Iir
|
19
|
+
module V20200417
|
20
|
+
# 检测到的主体在图片中的矩形框位置(四个顶点坐标)
|
21
|
+
class Location < TencentCloud::Common::AbstractModel
|
22
|
+
# @param XMin: 位置矩形框的左上角横坐标
|
23
|
+
# @type XMin: Integer
|
24
|
+
# @param YMin: 位置矩形框的左上角纵坐标
|
25
|
+
# @type YMin: Integer
|
26
|
+
# @param XMax: 位置矩形框的右下角横坐标
|
27
|
+
# @type XMax: Integer
|
28
|
+
# @param YMax: 位置矩形框的右下角纵坐标
|
29
|
+
# @type YMax: Integer
|
30
|
+
|
31
|
+
attr_accessor :XMin, :YMin, :XMax, :YMax
|
32
|
+
|
33
|
+
def initialize(xmin=nil, ymin=nil, xmax=nil, ymax=nil)
|
34
|
+
@XMin = xmin
|
35
|
+
@YMin = ymin
|
36
|
+
@XMax = xmax
|
37
|
+
@YMax = ymax
|
38
|
+
end
|
39
|
+
|
40
|
+
def deserialize(params)
|
41
|
+
@XMin = params['XMin']
|
42
|
+
@YMin = params['YMin']
|
43
|
+
@XMax = params['XMax']
|
44
|
+
@YMax = params['YMax']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# 图像识别出的商品的详细信息。
|
49
|
+
# 当图像中检测到多个物品时,会对显著性最高的物品进行识别。
|
50
|
+
class ProductInfo < TencentCloud::Common::AbstractModel
|
51
|
+
# @param FindSKU: 1表示找到同款商品,以下字段为同款商品信息;
|
52
|
+
# 0表示未找到同款商品, 具体商品信息为空(参考价格、名称、品牌等),仅提供商品类目。
|
53
|
+
# 是否找到同款的判断依据为Score分值,分值越大则同款的可能性越大。
|
54
|
+
# @type FindSKU: Integer
|
55
|
+
# @param Location: 本商品在图片中的坐标,表示为矩形框的四个顶点坐标。
|
56
|
+
# @type Location: :class:`Tencentcloud::Iir.v20200417.models.Location`
|
57
|
+
# @param Name: 商品名称
|
58
|
+
# @type Name: String
|
59
|
+
# @param Brand: 商品品牌
|
60
|
+
# @type Brand: String
|
61
|
+
# @param Price: 参考价格,综合多个信息源,仅供参考。
|
62
|
+
# @type Price: String
|
63
|
+
# @param ProductCategory: 识别结果的商品类目。
|
64
|
+
# 包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
|
65
|
+
# 当类别为“非商品”时,除Location、Score和本字段之外的商品信息为空。
|
66
|
+
# @type ProductCategory: String
|
67
|
+
# @param Score: 输入图片中的主体物品和输出结果的相似度。分值越大,输出结果与输入图片是同款的可能性越高。
|
68
|
+
# @type Score: Float
|
69
|
+
# @param Image: 搜索到的商品配图URL
|
70
|
+
# @type Image: String
|
71
|
+
|
72
|
+
attr_accessor :FindSKU, :Location, :Name, :Brand, :Price, :ProductCategory, :Score, :Image
|
73
|
+
|
74
|
+
def initialize(findsku=nil, location=nil, name=nil, brand=nil, price=nil, productcategory=nil, score=nil, image=nil)
|
75
|
+
@FindSKU = findsku
|
76
|
+
@Location = location
|
77
|
+
@Name = name
|
78
|
+
@Brand = brand
|
79
|
+
@Price = price
|
80
|
+
@ProductCategory = productcategory
|
81
|
+
@Score = score
|
82
|
+
@Image = image
|
83
|
+
end
|
84
|
+
|
85
|
+
def deserialize(params)
|
86
|
+
@FindSKU = params['FindSKU']
|
87
|
+
unless params['Location'].nil?
|
88
|
+
@Location = Location.new
|
89
|
+
@Location.deserialize(params['Location'])
|
90
|
+
end
|
91
|
+
@Name = params['Name']
|
92
|
+
@Brand = params['Brand']
|
93
|
+
@Price = params['Price']
|
94
|
+
@ProductCategory = params['ProductCategory']
|
95
|
+
@Score = params['Score']
|
96
|
+
@Image = params['Image']
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# RecognizeProduct请求参数结构体
|
101
|
+
class RecognizeProductRequest < TencentCloud::Common::AbstractModel
|
102
|
+
# @param ImageUrl: 图片限制:内测版仅支持jpg、jpeg,图片大小不超过1M,分辨率在25万到100万之间。
|
103
|
+
# 建议先对图片进行压缩,以便提升处理速度。
|
104
|
+
# @type ImageUrl: String
|
105
|
+
# @param ImageBase64: 图片经过base64编码的内容。最大不超过1M,分辨率在25万到100万之间。
|
106
|
+
# 与ImageUrl同时存在时优先使用ImageUrl字段。
|
107
|
+
# **注意:图片需要base64编码,并且要去掉编码头部。**
|
108
|
+
# @type ImageBase64: String
|
109
|
+
|
110
|
+
attr_accessor :ImageUrl, :ImageBase64
|
111
|
+
|
112
|
+
def initialize(imageurl=nil, imagebase64=nil)
|
113
|
+
@ImageUrl = imageurl
|
114
|
+
@ImageBase64 = imagebase64
|
115
|
+
end
|
116
|
+
|
117
|
+
def deserialize(params)
|
118
|
+
@ImageUrl = params['ImageUrl']
|
119
|
+
@ImageBase64 = params['ImageBase64']
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# RecognizeProduct返回参数结构体
|
124
|
+
class RecognizeProductResponse < TencentCloud::Common::AbstractModel
|
125
|
+
# @param RegionDetected: 检测到的图片中的商品位置和品类预测。
|
126
|
+
# 当图片中存在多个商品时,输出多组坐标,按照__显著性__排序(综合考虑面积、是否在中心、检测算法置信度)。
|
127
|
+
# 最多可以输出__3组__检测结果。
|
128
|
+
# @type RegionDetected: Array
|
129
|
+
# @param ProductInfo: 图像识别出的商品的详细信息。
|
130
|
+
# 当图像中检测到多个物品时,会对显著性最高的进行识别。
|
131
|
+
# @type ProductInfo: :class:`Tencentcloud::Iir.v20200417.models.ProductInfo`
|
132
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
133
|
+
# @type RequestId: String
|
134
|
+
|
135
|
+
attr_accessor :RegionDetected, :ProductInfo, :RequestId
|
136
|
+
|
137
|
+
def initialize(regiondetected=nil, productinfo=nil, requestid=nil)
|
138
|
+
@RegionDetected = regiondetected
|
139
|
+
@ProductInfo = productinfo
|
140
|
+
@RequestId = requestid
|
141
|
+
end
|
142
|
+
|
143
|
+
def deserialize(params)
|
144
|
+
unless params['RegionDetected'].nil?
|
145
|
+
@RegionDetected = []
|
146
|
+
params['RegionDetected'].each do |i|
|
147
|
+
regiondetected_tmp = RegionDetected.new
|
148
|
+
regiondetected_tmp.deserialize(i)
|
149
|
+
@RegionDetected << regiondetected_tmp
|
150
|
+
end
|
151
|
+
end
|
152
|
+
unless params['ProductInfo'].nil?
|
153
|
+
@ProductInfo = ProductInfo.new
|
154
|
+
@ProductInfo.deserialize(params['ProductInfo'])
|
155
|
+
end
|
156
|
+
@RequestId = params['RequestId']
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# 检测到的图片中的商品位置和品类预测。
|
161
|
+
# 当图片中存在多个商品时,输出多组坐标,按照__显著性__排序(综合考虑面积、是否在中心、检测算法置信度)。
|
162
|
+
# 最多可以输出__3组__检测结果。
|
163
|
+
class RegionDetected < TencentCloud::Common::AbstractModel
|
164
|
+
# @param Category: 商品的品类预测结果。
|
165
|
+
# 包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
|
166
|
+
# @type Category: String
|
167
|
+
# @param CategoryScore: 商品品类预测的置信度
|
168
|
+
# @type CategoryScore: Float
|
169
|
+
# @param Location: 检测到的主体在图片中的坐标,表示为矩形框的四个顶点坐标
|
170
|
+
# @type Location: :class:`Tencentcloud::Iir.v20200417.models.Location`
|
171
|
+
|
172
|
+
attr_accessor :Category, :CategoryScore, :Location
|
173
|
+
|
174
|
+
def initialize(category=nil, categoryscore=nil, location=nil)
|
175
|
+
@Category = category
|
176
|
+
@CategoryScore = categoryscore
|
177
|
+
@Location = location
|
178
|
+
end
|
179
|
+
|
180
|
+
def deserialize(params)
|
181
|
+
@Category = params['Category']
|
182
|
+
@CategoryScore = params['CategoryScore']
|
183
|
+
unless params['Location'].nil?
|
184
|
+
@Location = Location.new
|
185
|
+
@Location.deserialize(params['Location'])
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tencentcloud-sdk-iir
|
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
|
+
IIR.
|
30
|
+
email:
|
31
|
+
- tencentcloudapi@tencent.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/VERSION
|
37
|
+
- lib/tencentcloud-sdk-iir.rb
|
38
|
+
- lib/v20200417/client.rb
|
39
|
+
- lib/v20200417/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-iir
|
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 - IIR
|
66
|
+
test_files: []
|