model

package
v0.1.60 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDataOptionalParam

type AddDataOptionalParam struct {

	// 是否进行目标检测,默认为true。
	DoDet *bool `json:"do_det,omitempty"`

	// 目标矩形框坐标,如给定则不进行目标检测,直接使用该box作为目标。格式为“x1,y1,x2,y2”(无空格),x1/y1为目标左上角坐标,x2/y2为目标右下角坐标,具体要求如下: - 0 <= x1 < x2 <= width,默认要求x2-x1 >= 15,具体可参考服务类型说明。 - 0 <= y1 < y2 <= height,默认要求y2-y1 >= 15,具体可参考服务类型说明。
	Box *string `json:"box,omitempty"`

	// 是否进行对象分类,默认为true。
	DoCls *bool `json:"do_cls,omitempty"`

	// 对象类目,如给定则不进行对象分类,直接使用该category作为类目。具体类目信息可参见对应的服务类型说明。
	Category float32 `json:"category,omitempty"`
}

AddDataOptionalParam 添加数据的可选参数,其中每个参数仅对部分服务类型生效,具体可参见服务类型说明。

func (AddDataOptionalParam) String

func (o AddDataOptionalParam) String() string

type AddDataParam

type AddDataParam struct {

	// 是否强制添加数据,默认为false。 - false: 数据已存在则不进行添加。 - true: 数据已存在仍然覆盖添加。
	Force *bool `json:"force,omitempty"`

	// 数据的服务实例级唯一标识,字符长度范围为[1, 256]。
	ItemId string `json:"item_id"`

	// 数据的描述信息,字符长度范围为[1, 2048]。
	Desc *string `json:"desc,omitempty"`

	// 数据的自定义字符标签,用于进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 类型为字符串,字符长度范围为[1, 64]。
	CustomTags map[string]string `json:"custom_tags,omitempty"`

	// 数据的自定义数值标签,用于进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 类型为数值,格式为double。
	CustomNumTags map[string]float64 `json:"custom_num_tags,omitempty"`

	// 图像文件的base64字符串,图像入库时,与image_url二选一。要求如下: - 格式:目前仅支持JPEG/JPG/PNG/BMP/WEBP格式的图像。 - 大小:图像文件大小要求不超过5M。 - 尺寸:默认情况下,要求图像的最短边大于64px,最长边小于4096px。部分服务类型有特殊要求,可参见服务类型说明。 - 其他:图片中不能包含旋转信息。
	ImageBase64 *string `json:"image_base64,omitempty"`

	// 图像文件的服务可访问URL,字符长度范围为[1, 4096]。图像入库时,与image_base64二选一。
	ImageUrl *string `json:"image_url,omitempty"`

	// 关键词列表,关键词数量范围为[1, 100],关键词字符长度范围为[1, 64]。支持关键词搜索的服务实例添加数据时,如给定此参数,则直接使用给定的keywords作为关键词,否则会自动生成对应的keywords。
	Keywords *[]string `json:"keywords,omitempty"`

	OptionalParams *AddDataOptionalParam `json:"optional_params,omitempty"`
}

func (AddDataParam) String

func (o AddDataParam) String() string

type AddDataRestInfo

type AddDataRestInfo struct {
	ImageInfo *AddDataRestInfoImageInfo `json:"image_info,omitempty"`
}

AddDataRestInfo 添加数据的相关信息。

func (AddDataRestInfo) String

func (o AddDataRestInfo) String() string

type AddDataRestInfoImageInfo

type AddDataRestInfoImageInfo struct {

	// 添加的主体列表。
	Objects *[]AddDataRestInfoImageInfoObjects `json:"objects,omitempty"`
}

AddDataRestInfoImageInfo 添加图像数据的相关信息,不同服务类型返回信息不同,具体可参见服务类型说明。

func (AddDataRestInfoImageInfo) String

func (o AddDataRestInfoImageInfo) String() string

type AddDataRestInfoImageInfoObjects

type AddDataRestInfoImageInfoObjects struct {

	// 主体目标框。
	Box *string `json:"box,omitempty"`

	// 主体类目序号。
	Category float32 `json:"category,omitempty"`

	// 主体类目名称。
	CategoryName *string `json:"category_name,omitempty"`
}

func (AddDataRestInfoImageInfoObjects) String

type CheckInfo

type CheckInfo struct {

	// 符合条件的结果总数。
	TotalNum float32 `json:"total_num,omitempty"`

	// 返回的结果总数。
	ReturnNum float32 `json:"return_num,omitempty"`

	LastItem *SearchAfterParam `json:"last_item,omitempty"`
}

CheckInfo 检查结果的相关信息。

func (CheckInfo) String

func (o CheckInfo) String() string

type CheckParam

type CheckParam struct {

	// 数据的服务实例级唯一标识,字符长度范围为[1, 256]。 - item_id/custom_tags/custom_num_tags中必须给定至少一个参数,以支持对服务实例中的数据进行指定ID检查或条件检查。 - 如给定item_id参数,则进行指定ID检查,否则进行条件检查。
	ItemId *string `json:"item_id,omitempty"`

	// 返回检查结果的数量,默认为10,取值范围为[1, 100]。仅对条件检查生效。
	Limit *int32 `json:"limit,omitempty"`

	LastItem *SearchAfterParam `json:"last_item,omitempty"`

	// 自定义字符标签,用于对服务实例中的数据进行条件查找。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 标签值列表,列表内多个标签值为“或”关系,即满足一个即可。列表长度范围为[1, 32],标签值类型为字符串,字符长度范围为[1, 64]。
	CustomTags map[string][]string `json:"custom_tags,omitempty"`

	// 自定义数值标签,用于对服务实例中的数据进行条件查找。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。针对没有设置该数值标签的数据,会直接过滤。 - value: 标签值的取值范围,标签值在给定的取值范围内即视为符合条件。
	CustomNumTags map[string]RangeParam `json:"custom_num_tags,omitempty"`
}

func (CheckParam) String

func (o CheckParam) String() string

type CheckRestInfo

type CheckRestInfo struct {

	// 数据是否存在,存在返回true,不存在返回false。仅在指定ID检查时包含该字段。
	Existed *bool `json:"existed,omitempty"`

	ItemInfo *ItemSource `json:"item_info,omitempty"`

	// 检查结果列表,仅在条件检查时包含该字段。
	Items *[]SearchItem `json:"items,omitempty"`

	CheckInfo *CheckInfo `json:"check_info,omitempty"`
}

CheckRestInfo 检查数据的相关信息。

func (CheckRestInfo) String

func (o CheckRestInfo) String() string

type DeleteInfo

type DeleteInfo struct {

	// 符合条件的结果总数。
	TotalNum float32 `json:"total_num,omitempty"`

	// 本次删除的结果总数,目前一次请求最多删除100条结果。
	DeleteNum float32 `json:"delete_num,omitempty"`
}

DeleteInfo 删除结果的相关信息。

func (DeleteInfo) String

func (o DeleteInfo) String() string

type DeleteParam

type DeleteParam struct {

	// 是否幂等删除数据,默认为false。仅对指定ID删除生效。 - false: 数据不存在时返回错误信息。 - true: 数据不存在时返回成功,用于幂等删除场景。
	Force *bool `json:"force,omitempty"`

	// 数据的服务实例级唯一标识,字符长度范围为[1, 256]。 - item_id/custom_tags/custom_num_tags中必须给定至少一个参数,以支持对服务实例中的数据进行指定ID删除或条件删除。 - 如给定item_id参数,则进行指定ID删除,否则进行条件删除。
	ItemId *string `json:"item_id,omitempty"`

	// 自定义字符标签,用于对服务实例中的数据进行条件删除。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 标签值列表,列表内多个标签值为“或”关系,即满足一个即可。列表长度范围为[1, 32],标签值类型为字符串,字符长度范围为[1, 64]。
	CustomTags map[string][]string `json:"custom_tags,omitempty"`

	// 自定义数值标签,用于对服务实例中的数据进行custom_num_tags条件删除。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。针对没有设置该数值标签的数据,会直接过滤。 - value: 标签值的取值范围,标签值在给定的取值范围内即视为符合条件。
	CustomNumTags map[string]RangeParam `json:"custom_num_tags,omitempty"`
}

func (DeleteParam) String

func (o DeleteParam) String() string

type DeleteRestInfo

type DeleteRestInfo struct {

	// 删除数据列表。
	Items *[]DeleteRestInfoItems `json:"items,omitempty"`

	DeleteInfo *DeleteInfo `json:"delete_info,omitempty"`
}

DeleteRestInfo 删除数据的相关信息。

func (DeleteRestInfo) String

func (o DeleteRestInfo) String() string

type DeleteRestInfoItems

type DeleteRestInfoItems struct {

	// 数据唯一ID。
	Id *string `json:"id,omitempty"`
}

func (DeleteRestInfoItems) String

func (o DeleteRestInfoItems) String() string

type ItemSource

type ItemSource struct {

	// 数据描述信息。
	Desc *string `json:"desc,omitempty"`

	// 数据自定义字符标签。
	CustomTags map[string]string `json:"custom_tags,omitempty"`

	// 数据自定义数值标签。
	CustomNumTags map[string]float64 `json:"custom_num_tags,omitempty"`

	// 数据关键词列表。
	Keywords *[]string `json:"keywords,omitempty"`
}

ItemSource 数据的元信息,不同数据包含的字段可能不同。

func (ItemSource) String

func (o ItemSource) String() string

type RangeParam

type RangeParam struct {

	// 数值下界,默认包含该下界。
	From *float64 `json:"from,omitempty"`

	// 数值上界,默认包含该上界。
	To *float64 `json:"to,omitempty"`
}

RangeParam 数值范围参数结构体。

func (RangeParam) String

func (o RangeParam) String() string

type RunAddDataRequest

type RunAddDataRequest struct {

	// 服务实例的名称,用户创建服务实例时指定。
	ServiceName string `json:"service_name"`

	Body *AddDataParam `json:"body,omitempty"`
}

RunAddDataRequest Request Object

func (RunAddDataRequest) String

func (o RunAddDataRequest) String() string

type RunAddDataResponse

type RunAddDataResponse struct {

	// 添加数据完成返回success。
	Result *string `json:"result,omitempty"`

	Data           *AddDataRestInfo `json:"data,omitempty"`
	HttpStatusCode int              `json:"-"`
}

RunAddDataResponse Response Object

func (RunAddDataResponse) String

func (o RunAddDataResponse) String() string

type RunCheckDataRequest

type RunCheckDataRequest struct {

	// 服务实例的名称,用户创建服务实例时指定。
	ServiceName string `json:"service_name"`

	Body *CheckParam `json:"body,omitempty"`
}

RunCheckDataRequest Request Object

func (RunCheckDataRequest) String

func (o RunCheckDataRequest) String() string

type RunCheckDataResponse

type RunCheckDataResponse struct {

	// 检查数据完成返回success。
	Result *string `json:"result,omitempty"`

	Data           *CheckRestInfo `json:"data,omitempty"`
	HttpStatusCode int            `json:"-"`
}

RunCheckDataResponse Response Object

func (RunCheckDataResponse) String

func (o RunCheckDataResponse) String() string

type RunDeleteDataRequest

type RunDeleteDataRequest struct {

	// 服务实例的名称,用户创建服务实例时指定。
	ServiceName string `json:"service_name"`

	Body *DeleteParam `json:"body,omitempty"`
}

RunDeleteDataRequest Request Object

func (RunDeleteDataRequest) String

func (o RunDeleteDataRequest) String() string

type RunDeleteDataResponse

type RunDeleteDataResponse struct {

	// 删除数据完成返回success。
	Result *string `json:"result,omitempty"`

	Data           *DeleteRestInfo `json:"data,omitempty"`
	HttpStatusCode int             `json:"-"`
}

RunDeleteDataResponse Response Object

func (RunDeleteDataResponse) String

func (o RunDeleteDataResponse) String() string

type RunSearchRequest

type RunSearchRequest struct {

	// 服务实例的名称,用户创建服务实例时指定。
	ServiceName string `json:"service_name"`

	Body *SearchParam `json:"body,omitempty"`
}

RunSearchRequest Request Object

func (RunSearchRequest) String

func (o RunSearchRequest) String() string

type RunSearchResponse

type RunSearchResponse struct {

	// 搜索完成返回success。
	Result *string `json:"result,omitempty"`

	Data           *SearchRestInfo `json:"data,omitempty"`
	HttpStatusCode int             `json:"-"`
}

RunSearchResponse Response Object

func (RunSearchResponse) String

func (o RunSearchResponse) String() string

type RunUpdateDataRequest

type RunUpdateDataRequest struct {

	// 服务实例的名称,用户创建服务实例时指定。
	ServiceName string `json:"service_name"`

	Body *UpdateParam `json:"body,omitempty"`
}

RunUpdateDataRequest Request Object

func (RunUpdateDataRequest) String

func (o RunUpdateDataRequest) String() string

type RunUpdateDataResponse

type RunUpdateDataResponse struct {

	// 更新数据完成返回success。
	Result         *string `json:"result,omitempty"`
	HttpStatusCode int     `json:"-"`
}

RunUpdateDataResponse Response Object

func (RunUpdateDataResponse) String

func (o RunUpdateDataResponse) String() string

type SearchAfterParam

type SearchAfterParam struct {

	// 结果的得分。
	Score *float64 `json:"score,omitempty"`

	// 结果的唯一ID。
	Id *string `json:"id,omitempty"`
}

SearchAfterParam 最后一个结果的排序信息,用于全量召回场景。 - 目前仅KEYWORD搜索和条件检查支持全量召回。

func (SearchAfterParam) String

func (o SearchAfterParam) String() string

type SearchInfo

type SearchInfo struct {

	// 搜索结果总数。
	TotalNum float32 `json:"total_num,omitempty"`

	// 返回结果总数。
	ReturnNum float32 `json:"return_num,omitempty"`

	// 搜索过程耗时,单位为毫秒。
	SearchTime float32 `json:"search_time,omitempty"`

	LastItem *SearchAfterParam `json:"last_item,omitempty"`
}

SearchInfo 搜索结果的相关信息。

func (SearchInfo) String

func (o SearchInfo) String() string

type SearchItem

type SearchItem struct {

	// 数据唯一ID。
	Id *string `json:"id,omitempty"`

	// 数据匹配分数。
	Score *float64 `json:"score,omitempty"`

	Source *ItemSource `json:"source,omitempty"`
}

SearchItem 搜索结果参数结构体。

func (SearchItem) String

func (o SearchItem) String() string

type SearchOptionalParam

type SearchOptionalParam struct {

	// 是否进行目标检测,默认为true。
	DoDet *bool `json:"do_det,omitempty"`

	// 目标矩形框坐标,如给定则不进行目标检测,直接使用该box作为目标。格式为“x1,y1,x2,y2”(无空格),x1/y1为目标左上角坐标,x2/y2为目标右下角坐标,具体要求如下: - 0 <= x1 < x2 <= width,默认要求x2-x1 >= 15,具体可参考服务类型说明。 - 0 <= y1 < y2 <= height,默认要求y2-y1 >= 15,具体可参考服务类型说明。
	Box *string `json:"box,omitempty"`

	// 是否进行对象分类,默认为true。
	DoCls *bool `json:"do_cls,omitempty"`

	// 对象类目,如给定则不进行对象分类,直接使用该category作为类目。具体类目信息可参见对应的服务类型说明。
	Category float32 `json:"category,omitempty"`

	// 去重标签名,必须为服务实例custom_tags中已存在的key。 - 如给定则会对该key下相同value的数据进行去重,仅保留得分最高的数据。 - 针对没有设置该标签的数据,会直接过滤。
	CollapseKey *string `json:"collapse_key,omitempty"`

	// 扫描节点上限。值越大精度越高,查询速度变慢。默认值为10000。
	MaxScanNum *int32 `json:"max_scan_num,omitempty"`

	// 查询考察中心点的数目。值越大精度越高,查询速度变慢。默认值为100。
	Nprobe *int32 `json:"nprobe,omitempty"`
}

SearchOptionalParam 搜索的可选参数,其中每个参数仅对部分服务类型生效,具体可参见服务类型说明。

func (SearchOptionalParam) String

func (o SearchOptionalParam) String() string

type SearchParam

type SearchParam struct {

	// 搜索类型,必须为服务实例支持的搜索类型。服务实例的搜索类型列表可在创建服务实例时进行配置。 > 可以使用枚举名或者枚举值(例如IMAGE/0),枚举值可能会变动,建议使用枚举名。
	SearchType SearchParamSearchType `json:"search_type"`

	// 返回搜索结果的数量,默认为10,取值范围为[1, 100]。
	Limit *int32 `json:"limit,omitempty"`

	// 返回搜索结果的偏移量,即返回序号在[offset, offset+limit]内的搜索结果。默认为0,取值范围为[0, N]。 - 默认情况下,搜索要求offset+limit <= 1000。 - 针对支持全量召回的场景,使用全量召回时,要求offset必须为0。
	Offset *int32 `json:"offset,omitempty"`

	LastItem *SearchAfterParam `json:"last_item,omitempty"`

	// 返回搜索结果的最小得分,用于对搜索结果进行score过滤,取值范围为[0, 1]。 - 目前仅对IMAGE/CATEGORY搜索类型生效。
	MinScore *float64 `json:"min_score,omitempty"`

	// 自定义字符标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 标签值列表,列表内多个标签值为“或”关系,即满足一个即可。列表长度范围为[1, 32],标签值类型为字符串,字符长度范围为[1, 64]。
	CustomTags map[string][]string `json:"custom_tags,omitempty"`

	// 自定义数值标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。针对没有设置该数值标签的数据,会直接过滤。 - value: 标签值的取值范围,标签值在给定的取值范围内即视为符合条件。
	CustomNumTags map[string]RangeParam `json:"custom_num_tags,omitempty"`

	// 图像文件的base64字符串,基于图像搜索时,与image_url二选一。要求如下: - 格式:目前仅支持JPEG/JPG/PNG/BMP/WEBP格式的图像。 - 大小:图像文件大小要求不超过5M。 - 尺寸:默认情况下,要求图像的最短边大于64px,最长边小于4096px。部分服务类型有特殊要求,可参见服务类型说明。 - 其他:图片中不能包含旋转信息。
	ImageBase64 *string `json:"image_base64,omitempty"`

	// 图像文件的服务可访问URL,字符长度范围为[1, 4096]。基于图像搜索时,与image_base64二选一。
	ImageUrl *string `json:"image_url,omitempty"`

	// 关键词列表,搜索时关键词数量范围为[1, 10],关键词字符长度范围为[1, 64]。使用KEYWORD搜索类型进行搜索时,必须提供该参数。
	Keywords *[]string `json:"keywords,omitempty"`

	OptionalParams *SearchOptionalParam `json:"optional_params,omitempty"`
}

func (SearchParam) String

func (o SearchParam) String() string

type SearchParamSearchType

type SearchParamSearchType struct {
	// contains filtered or unexported fields
}

func (SearchParamSearchType) MarshalJSON

func (c SearchParamSearchType) MarshalJSON() ([]byte, error)

func (*SearchParamSearchType) UnmarshalJSON

func (c *SearchParamSearchType) UnmarshalJSON(b []byte) error

func (SearchParamSearchType) Value

func (c SearchParamSearchType) Value() string

type SearchParamSearchTypeEnum

type SearchParamSearchTypeEnum struct {
	IMAGE    SearchParamSearchType
	KEYWORD  SearchParamSearchType
	CATEGORY SearchParamSearchType
}

func GetSearchParamSearchTypeEnum

func GetSearchParamSearchTypeEnum() SearchParamSearchTypeEnum

type SearchRestInfo

type SearchRestInfo struct {

	// 搜索结果列表。
	Items *[]SearchItem `json:"items,omitempty"`

	SearchInfo *SearchInfo `json:"search_info,omitempty"`

	ImageInfo *SearchRestInfoImageInfo `json:"image_info,omitempty"`
}

SearchRestInfo 搜索的相关信息。

func (SearchRestInfo) String

func (o SearchRestInfo) String() string

type SearchRestInfoImageInfo

type SearchRestInfoImageInfo struct {

	// 用于搜索的主体目标框。
	Box *string `json:"box,omitempty"`

	// 用于搜索的主体类目序号。
	Category float32 `json:"category,omitempty"`

	// 用于搜索的主体类目名称。
	CategoryName *string `json:"category_name,omitempty"`

	// 搜索图像中的所有主体列表。
	Objects *[]AddDataRestInfoImageInfoObjects `json:"objects,omitempty"`
}

SearchRestInfoImageInfo 搜索图像的相关信息,不同服务类型返回信息不同,具体可参见服务类型说明。

func (SearchRestInfoImageInfo) String

func (o SearchRestInfoImageInfo) String() string

type UpdateParam

type UpdateParam struct {

	// 数据的服务实例级唯一标识,字符长度范围为[1, 256]。
	ItemId string `json:"item_id"`

	// 数据的描述信息,字符长度范围为[1, 2048]。
	Desc *string `json:"desc,omitempty"`

	// 数据的自定义字符标签,用于进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 类型为字符串,字符长度范围为[1, 64]。
	CustomTags map[string]string `json:"custom_tags,omitempty"`

	// 数据的自定义数值标签,用于进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 类型为数值,格式为double。
	CustomNumTags map[string]float64 `json:"custom_num_tags,omitempty"`
}

func (UpdateParam) String

func (o UpdateParam) String() string

Jump to

Keyboard shortcuts

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