REST Resource: projects.locations.products.referenceImages

资源:ReferenceImage

ReferenceImage 表示商品图片及其关联的元数据,例如边界框。

JSON 表示法
{
  "name": string,
  "uri": string,
  "boundingPolys": [
    {
      object(BoundingPoly)
    }
  ]
}
字段
name

string

参考图片的资源名称。

格式为:

projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

创建参考图片时,系统会忽略此字段。

uri

string

参考图片的 Google Cloud Storage URI。

URI 必须以 gs:// 开头。

必填。

boundingPolys[]

object(BoundingPoly)

参考图片内感兴趣的区域周围的边界多边形。可选。如果此字段为空,系统将尝试检测感兴趣的区域。最多可使用 10 个边界多边形。

所提供的形状将转换为非旋转式矩形。转换完毕后,矩形的短边必须大于或等于 300 像素。宽高比不得超过 1:4(即 1:3 可接受,1:5 则不可接受)。

BoundingPoly

检测到的图片注释的边界多边形。

JSON 表示法
{
  "vertices": [
    {
      object(Vertex)
    }
  ],
  "normalizedVertices": [
    {
      object(NormalizedVertex)
    }
  ]
}
字段
vertices[]

object(Vertex)

外接多边形的顶点。

normalizedVertices[]

object(NormalizedVertex)

外接多边形的规范化顶点。

Vertex

顶点表示图片中的 2D 点。注意:顶点坐标与原始图片的比例相同。

JSON 表示法
{
  "x": number,
  "y": number
}
字段
x

number

x 坐标。

y

number

y 坐标。

Zero coordinate values


The general format for bounding polys in the JSON response when detected is an array of 4 vertex objects:
  • [{"x": 63,"y": 18},{"x": 123,"y": 18},{"x": 123,"y": 38},{"x": 63,"y": 38}]
When the API detects a coordinate ("x" or "y") value of 0, that coordinate is omitted in the JSON response. For example, a response could take the following form: [{},{"x": 28}, {"x": 28,"y": 43},{"y": 43}]. This response shows all three representation possibilities:
  • {} - an empty object when both "x":0 and "y":0.
  • {"x": 28} and {"y": 43} - an object with a single key-value pair when one coordinate is 0 but the other is a non-zero value.
  • {"x": 28,"y": 43} - an object with both key-value pairs when both coordinates have a non-zero value.

NormalizedVertex

顶点表示图片中的 2D 点。注意:标准化顶点坐标相对于原始图片,范围介于 0 和 1 之间。

JSON 表示法
{
  "x": number,
  "y": number
}
字段
x

number

x 坐标。

y

number

y 坐标。

Zero coordinate values


The general format for bounding polys in the JSON response when detected is an array of 4 vertex objects:
  • [{"x": 0.063,"y": 0.018},{"x": 0.123,"y": 0.018},{"x": 0.123,"y": 0.038},{"x": 0.063,"y": 0.038}]
When the API detects a coordinate ("x" or "y") value of 0.0, that coordinate is omitted in the JSON response. For example, a response could take the following form: [{},{"x": 0.028}, {"x": 0.028,"y": 0.043},{"y": 0.043}]. This response shows all three representation possibilities:
  • {} - an empty object when both "x":0.0 and "y":0.0.
  • {"x": 0.028} and {"y": 0.043} - an object with a single key-value pair when one coordinate is 0.0 but the other is a non-zero value.
  • {"x": 0.028,"y": 0.043} - an object with both key-value pairs when both coordinates have a non-zero value.

方法

create

创建并返回新的 ReferenceImage 资源。

delete

永久删除一张参考图片。

get

获取与 ReferenceImage 关联的信息。

list

列出参考图片。