Current section
Files
Jump to
Current section
Files
lib/googly/cloud_vision/model/reference_image.ex
# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudVision.Model.ReferenceImage do
@moduledoc """
A `ReferenceImage` represents a product image and its associated metadata, such as bounding boxes.
## Attributes
* `bounding_polys` (*type:* `list(Googly.CloudVision.Model.BoundingPoly.t())`) - Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
* `name` (*type:* `String.t()`) - The resource name of the reference image. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This field is ignored when creating a reference image.
* `uri` (*type:* `String.t()`) - Required. The Google Cloud Storage URI of the reference image. The URI must start with `gs://`.
"""
defstruct [:bounding_polys, :name, :uri]
@type t :: %__MODULE__{
bounding_polys: list(Googly.CloudVision.Model.BoundingPoly.t()) | nil,
name: String.t() | nil,
uri: String.t() | nil
}
@wire %{bounding_polys: "boundingPolys"}
@doc false
def __wire__, do: @wire
@doc false
def decode(nil), do: nil
def decode(list) when is_list(list), do: Enum.map(list, &decode/1)
def decode(m) do
%__MODULE__{
bounding_polys: Googly.CloudVision.Model.BoundingPoly.decode(m["boundingPolys"]),
name: m["name"],
uri: m["uri"]
}
end
end