v20200417

package
v1.0.935 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// 文件下载失败。
	FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"

	// 图片解码失败。
	FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"

	// 不支持的图片文件。
	FAILEDOPERATION_IMAGENOTSUPPORTED = "FailedOperation.ImageNotSupported"

	// 图片不满足检测要求。
	FAILEDOPERATION_IMAGEUNQUALIFIED = "FailedOperation.ImageUnQualified"

	// 后端服务超时。
	FAILEDOPERATION_REQUESTTIMEOUT = "FailedOperation.RequestTimeout"

	// 算法服务异常,请重试。
	FAILEDOPERATION_SERVERERROR = "FailedOperation.ServerError"

	// 内部错误。
	FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"

	// 服务未开通。
	FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"

	// 参数值错误。
	INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"

	// 文件太大。
	LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"

	// 计费状态未知,请确认是否已在控制台开通服务。
	RESOURCEUNAVAILABLE_NOTEXIST = "ResourceUnavailable.NotExist"
)
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.CredentialIface, 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)

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

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

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

可能返回的错误码:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_IMAGENOTSUPPORTED = "FailedOperation.ImageNotSupported"
FAILEDOPERATION_IMAGEUNQUALIFIED = "FailedOperation.ImageUnQualified"
FAILEDOPERATION_REQUESTTIMEOUT = "FailedOperation.RequestTimeout"
FAILEDOPERATION_SERVERERROR = "FailedOperation.ServerError"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCEUNAVAILABLE_NOTEXIST = "ResourceUnavailable.NotExist"

func (*Client) RecognizeProductWithContext added in v1.0.324

func (c *Client) RecognizeProductWithContext(ctx context.Context, request *RecognizeProductRequest) (response *RecognizeProductResponse, err error)

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

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

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

可能返回的错误码:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_IMAGENOTSUPPORTED = "FailedOperation.ImageNotSupported"
FAILEDOPERATION_IMAGEUNQUALIFIED = "FailedOperation.ImageUnQualified"
FAILEDOPERATION_REQUESTTIMEOUT = "FailedOperation.RequestTimeout"
FAILEDOPERATION_SERVERERROR = "FailedOperation.ServerError"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCEUNAVAILABLE_NOTEXIST = "ResourceUnavailable.NotExist"

type Location

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

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

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

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

type ProductInfo

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

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

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

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

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

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

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

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

type RecognizeProductRequest

type RecognizeProductRequest struct {
	*tchttp.BaseRequest

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

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

func NewRecognizeProductRequest

func NewRecognizeProductRequest() (request *RecognizeProductRequest)

func (*RecognizeProductRequest) FromJsonString

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

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*RecognizeProductRequest) ToJsonString

func (r *RecognizeProductRequest) ToJsonString() string

type RecognizeProductRequestParams added in v1.0.426

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

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

Predefined struct for user

type RecognizeProductResponse

type RecognizeProductResponse struct {
	*tchttp.BaseResponse
	Response *RecognizeProductResponseParams `json:"Response"`
}

func NewRecognizeProductResponse

func NewRecognizeProductResponse() (response *RecognizeProductResponse)

func (*RecognizeProductResponse) FromJsonString

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

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*RecognizeProductResponse) ToJsonString

func (r *RecognizeProductResponse) ToJsonString() string

type RecognizeProductResponseParams added in v1.0.426

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

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

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

Predefined struct for user

type RegionDetected

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

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

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

Jump to

Keyboard shortcuts

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