Packages

Google Cloud Vision API client library.

Current section

Files

Jump to
googly_cloud_vision lib googly cloud_vision model image_context.ex
Raw

lib/googly/cloud_vision/model/image_context.ex

# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudVision.Model.ImageContext do
@moduledoc """
Image context and/or feature-specific parameters.
## Attributes
* `crop_hints_params` (*type:* `Googly.CloudVision.Model.CropHintsParams.t()`) - Parameters for crop hints annotation request.
* `language_hints` (*type:* `list(String.t())`) - List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the [supported languages](https://cloud.google.com/vision/docs/languages).
* `lat_long_rect` (*type:* `Googly.CloudVision.Model.LatLongRect.t()`) - Not used.
* `product_search_params` (*type:* `Googly.CloudVision.Model.ProductSearchParams.t()`) - Parameters for product search.
* `text_detection_params` (*type:* `Googly.CloudVision.Model.TextDetectionParams.t()`) - Parameters for text detection and document text detection.
* `web_detection_params` (*type:* `Googly.CloudVision.Model.WebDetectionParams.t()`) - Parameters for web detection.
"""
defstruct [
:crop_hints_params,
:language_hints,
:lat_long_rect,
:product_search_params,
:text_detection_params,
:web_detection_params
]
@type t :: %__MODULE__{
crop_hints_params: Googly.CloudVision.Model.CropHintsParams.t() | nil,
language_hints: list(String.t()) | nil,
lat_long_rect: Googly.CloudVision.Model.LatLongRect.t() | nil,
product_search_params: Googly.CloudVision.Model.ProductSearchParams.t() | nil,
text_detection_params: Googly.CloudVision.Model.TextDetectionParams.t() | nil,
web_detection_params: Googly.CloudVision.Model.WebDetectionParams.t() | nil
}
@wire %{
crop_hints_params: "cropHintsParams",
language_hints: "languageHints",
lat_long_rect: "latLongRect",
product_search_params: "productSearchParams",
text_detection_params: "textDetectionParams",
web_detection_params: "webDetectionParams"
}
@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__{
crop_hints_params: Googly.CloudVision.Model.CropHintsParams.decode(m["cropHintsParams"]),
language_hints: m["languageHints"],
lat_long_rect: Googly.CloudVision.Model.LatLongRect.decode(m["latLongRect"]),
product_search_params:
Googly.CloudVision.Model.ProductSearchParams.decode(m["productSearchParams"]),
text_detection_params:
Googly.CloudVision.Model.TextDetectionParams.decode(m["textDetectionParams"]),
web_detection_params:
Googly.CloudVision.Model.WebDetectionParams.decode(m["webDetectionParams"])
}
end
end