v20200417

package
v3.0.233+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "2020-04-17"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

Deprecated

func (*Client) RecognizeProduct

func (c *Client) RecognizeProduct(request *RecognizeProductRequest) (response *RecognizeProductResponse, err error)

商品识别,使用微信扫一扫识物同款技术,基于人工智能技术、海量训练图片、亿级商品库,可以实现全覆盖、细粒度、高准确率的商品识别和商品推荐功能。 本服务可以识别出图片中的主体位置、主体商品类型,覆盖亿级SKU,输出具体商品的价格、型号等详细信息。 客户无需自建商品库,即可快速实现商品识别、拍照搜商品等功能。

目前“商品识别”为公测服务,需要申请、开通后方可使用。请在[服务开通申请表](https://cloud.tencent.com/apply/p/y1q2mnf0vdl) 中填写详细信息和需求,如果通过审核,我们将会在2个工作日内与您联系,并开通服务。 公测期间,本服务免费提供最高2QPS,收费模式和标准会在正式版上线前通过站内信、短信通知客户。如果需要提升并发,请与我们联系洽谈。

注意:本文档为公测版本,仅适用于功能体验和测试,正式业务接入请等待正式版。正式版的输入、输出可能会与公测版存在少量差异。

type Location

type Location struct {

	// 位置矩形框的左上角横坐标
	XMin *int64 `json:"XMin,omitempty" name:"XMin"`

	// 位置矩形框的左上角纵坐标
	YMin *int64 `json:"YMin,omitempty" name:"YMin"`

	// 位置矩形框的右下角横坐标
	XMax *int64 `json:"XMax,omitempty" name:"XMax"`

	// 位置矩形框的右下角纵坐标
	YMax *int64 `json:"YMax,omitempty" name:"YMax"`
}

type ProductInfo

type ProductInfo struct {

	// 1表示找到同款商品,以下字段为同款商品信息;
	// 0表示未找到同款商品, 具体商品信息为空(参考价格、名称、品牌等),仅提供商品类目。
	// 是否找到同款的判断依据为Score分值,分值越大则同款的可能性越大。
	FindSKU *int64 `json:"FindSKU,omitempty" name:"FindSKU"`

	// 本商品在图片中的坐标,表示为矩形框的四个顶点坐标。
	Location *Location `json:"Location,omitempty" name:"Location"`

	// 商品名称
	Name *string `json:"Name,omitempty" name:"Name"`

	// 商品品牌
	Brand *string `json:"Brand,omitempty" name:"Brand"`

	// 参考价格,综合多个信息源,仅供参考。
	Price *string `json:"Price,omitempty" name:"Price"`

	// 识别结果的商品类目。
	// 包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
	// 当类别为“非商品”时,除Location、Score和本字段之外的商品信息为空。
	ProductCategory *string `json:"ProductCategory,omitempty" name:"ProductCategory"`

	// 输入图片中的主体物品和输出结果的相似度。分值越大,输出结果与输入图片是同款的可能性越高。
	Score *float64 `json:"Score,omitempty" name:"Score"`

	// 搜索到的商品配图URL
	Image *string `json:"Image,omitempty" name:"Image"`
}

type RecognizeProductRequest

type RecognizeProductRequest struct {
	*tchttp.BaseRequest

	// 图片限制:内测版仅支持jpg、jpeg,图片大小不超过1M,分辨率在25万到100万之间。
	// 建议先对图片进行压缩,以便提升处理速度。
	ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"`

	// 图片经过base64编码的内容。最大不超过1M,分辨率在25万到100万之间。
	// 与ImageUrl同时存在时优先使用ImageUrl字段。
	// **注意:图片需要base64编码,并且要去掉编码头部。**
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`
}

func NewRecognizeProductRequest

func NewRecognizeProductRequest() (request *RecognizeProductRequest)

func (*RecognizeProductRequest) FromJsonString

func (r *RecognizeProductRequest) FromJsonString(s string) error

func (*RecognizeProductRequest) ToJsonString

func (r *RecognizeProductRequest) ToJsonString() string

type RecognizeProductResponse

type RecognizeProductResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 检测到的图片中的商品位置和品类预测。
		// 当图片中存在多个商品时,输出多组坐标,按照__显著性__排序(综合考虑面积、是否在中心、检测算法置信度)。
		// 最多可以输出__3组__检测结果。
		RegionDetected []*RegionDetected `json:"RegionDetected,omitempty" name:"RegionDetected" list`

		// 图像识别出的商品的详细信息。
		// 当图像中检测到多个物品时,会对显著性最高的进行识别。
		ProductInfo *ProductInfo `json:"ProductInfo,omitempty" name:"ProductInfo"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewRecognizeProductResponse

func NewRecognizeProductResponse() (response *RecognizeProductResponse)

func (*RecognizeProductResponse) FromJsonString

func (r *RecognizeProductResponse) FromJsonString(s string) error

func (*RecognizeProductResponse) ToJsonString

func (r *RecognizeProductResponse) ToJsonString() string

type RegionDetected

type RegionDetected struct {

	// 商品的品类预测结果。
	// 包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
	Category *string `json:"Category,omitempty" name:"Category"`

	// 商品品类预测的置信度
	CategoryScore *float64 `json:"CategoryScore,omitempty" name:"CategoryScore"`

	// 检测到的主体在图片中的坐标,表示为矩形框的四个顶点坐标
	Location *Location `json:"Location,omitempty" name:"Location"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL