Current section
Files
Jump to
Current section
Files
lib/googly/cloud_vision/model/crop_hint.ex
# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudVision.Model.CropHint do
@moduledoc """
Single crop hint that is used to generate a new crop when serving an image.
## Attributes
* `bounding_poly` (*type:* `Googly.CloudVision.Model.BoundingPoly.t()`) - The bounding polygon for the crop region. The coordinates of the bounding box are in the original image's scale.
* `confidence` (*type:* `number()`) - Confidence of this being a salient region. Range [0, 1].
* `importance_fraction` (*type:* `number()`) - Fraction of importance of this salient region with respect to the original image.
"""
defstruct [:bounding_poly, :confidence, :importance_fraction]
@type t :: %__MODULE__{
bounding_poly: Googly.CloudVision.Model.BoundingPoly.t() | nil,
confidence: number() | nil,
importance_fraction: number() | nil
}
@wire %{bounding_poly: "boundingPoly", importance_fraction: "importanceFraction"}
@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_poly: Googly.CloudVision.Model.BoundingPoly.decode(m["boundingPoly"]),
confidence: m["confidence"],
importance_fraction: m["importanceFraction"]
}
end
end