blob: ad215e3b3f85b476f1f159d4362e8fe01aafcf25 [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="vision_v1p2beta1.html">Cloud Vision API</a> . <a href="vision_v1p2beta1.projects.html">projects</a> . <a href="vision_v1p2beta1.projects.images.html">images</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#annotate">annotate(parent, body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Run image detection and annotation for a batch of images.</p>
80<p class="toc_element">
81 <code><a href="#asyncBatchAnnotate">asyncBatchAnnotate(parent, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070082<p class="firstline">Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.</p>
83<p class="toc_element">
84 <code><a href="#close">close()</a></code></p>
85<p class="firstline">Close httplib2 connections.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070086<h3>Method Details</h3>
87<div class="method">
88 <code class="details" id="annotate">annotate(parent, body=None, x__xgafv=None)</code>
89 <pre>Run image detection and annotation for a batch of images.
90
91Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070092 parent: string, Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -070093 body: object, The request body.
94 The object takes the form of:
95
96{ # Multiple image annotation requests are batched into a single service call.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -070097 &quot;parent&quot;: &quot;A String&quot;, # Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.
Bu Sun Kim65020912020-05-20 12:08:20 -070098 &quot;requests&quot;: [ # Required. Individual image annotation requests for this batch.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070099 { # Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700100 &quot;imageContext&quot;: { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800101 &quot;languageHints&quot;: [ # 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).
102 &quot;A String&quot;,
103 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800104 &quot;latLongRect&quot;: { # Rectangle determined by min and max `LatLng` pairs. # Not used.
105 &quot;minLatLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # Min lat/long pair.
106 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
107 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
108 },
109 &quot;maxLatLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # Max lat/long pair.
110 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
111 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
112 },
113 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700114 &quot;cropHintsParams&quot;: { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
115 &quot;aspectRatios&quot;: [ # Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.
116 3.14,
117 ],
118 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800119 &quot;webDetectionParams&quot;: { # Parameters for web detection request. # Parameters for web detection.
120 &quot;includeGeoResults&quot;: True or False, # Whether to include results derived from the geo information in the image.
121 },
122 &quot;productSearchParams&quot;: { # Parameters for a product search request. # Parameters for product search.
123 &quot;filter&quot;: &quot;A String&quot;, # The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An &#x27;=&#x27; should be used to connect the key and value. For example, &quot;(color = red OR color = blue) AND brand = Google&quot; is acceptable, but &quot;(color = red OR brand = Google)&quot; is not acceptable. &quot;color: red&quot; is not acceptable because it uses a &#x27;:&#x27; instead of an &#x27;=&#x27;.
124 &quot;productCategories&quot;: [ # The list of product categories to search in. Currently, we only consider the first category, and either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;, &quot;packagedgoods-v1&quot;, or &quot;general-v1&quot; should be specified. The legacy categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported but will be deprecated. For new products, please use &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, or &quot;toys-v2&quot; for better product search accuracy. It is recommended to migrate existing products to these categories as well.
125 &quot;A String&quot;,
126 ],
127 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
128 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
129 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
130 &quot;x&quot;: 3.14, # X coordinate.
131 &quot;y&quot;: 3.14, # Y coordinate.
132 },
133 ],
134 &quot;vertices&quot;: [ # The bounding polygon vertices.
135 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
136 &quot;x&quot;: 42, # X coordinate.
137 &quot;y&quot;: 42, # Y coordinate.
138 },
139 ],
140 },
141 &quot;productSet&quot;: &quot;A String&quot;, # The resource name of a ProductSet to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
142 },
143 },
144 &quot;image&quot;: { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
145 &quot;content&quot;: &quot;A String&quot;, # Image content, represented as a stream of bytes. Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests.
146 &quot;source&quot;: { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image URL. If both `content` and `source` are provided for an image, `content` takes precedence and is used to perform the image annotation request.
147 &quot;imageUri&quot;: &quot;A String&quot;, # The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from HTTP/HTTPS URLs, Google cannot guarantee that the request will be completed. Your request may fail if the specified host denies the request (e.g. due to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes precedence.
148 &quot;gcsImageUri&quot;: &quot;A String&quot;, # **Use `image_uri` instead.** The Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
149 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700150 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800151 &quot;features&quot;: [ # Requested features.
152 { # The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple `Feature` objects can be specified in the `features` list.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800153 &quot;maxResults&quot;: 42, # Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800154 &quot;model&quot;: &quot;A String&quot;, # Model to use for the feature. Supported values: &quot;builtin/stable&quot; (the default if unset) and &quot;builtin/latest&quot;.
155 &quot;type&quot;: &quot;A String&quot;, # The feature type.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800156 },
157 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 },
159 ],
160 }
161
162 x__xgafv: string, V1 error format.
163 Allowed values
164 1 - v1 error format
165 2 - v2 error format
166
167Returns:
168 An object of the form:
169
170 { # Response to a batch image annotation request.
171 &quot;responses&quot;: [ # Individual responses to image annotation requests within the batch.
172 { # Response to an image annotation request.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700173 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when `error` is set.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700174 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
175 {
176 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
177 },
178 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800179 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700180 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
181 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800182 &quot;textAnnotations&quot;: [ # If present, text (OCR) detection has completed successfully.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800183 { # Set of detected entity features.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800184 &quot;locations&quot;: [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks.
185 { # Detected entity location information.
186 &quot;latLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates.
187 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
188 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
189 },
190 },
191 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700192 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1].
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800193 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of &quot;tower&quot; is likely higher to an image containing the detected &quot;Eiffel Tower&quot; than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1].
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700194 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700195 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
196 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700197 &quot;x&quot;: 3.14, # X coordinate.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800198 &quot;y&quot;: 3.14, # Y coordinate.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700199 },
200 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800201 &quot;vertices&quot;: [ # The bounding polygon vertices.
202 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
203 &quot;x&quot;: 42, # X coordinate.
204 &quot;y&quot;: 42, # Y coordinate.
205 },
206 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700207 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800208 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800209 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800210 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700211 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity.
212 { # A `Property` consists of a user-supplied name/value pair.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800213 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700214 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800215 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700216 },
217 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800218 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual `description` is expressed.
219 },
220 ],
221 &quot;localizedObjectAnnotations&quot;: [ # If present, localized object detection has completed successfully. This will be sorted descending by confidence score.
222 { # Set of detected objects with bounding boxes.
223 &quot;mid&quot;: &quot;A String&quot;, # Object ID that should align with EntityAnnotation mid.
224 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this object belongs. This must be populated.
225 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
226 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
227 &quot;x&quot;: 3.14, # X coordinate.
228 &quot;y&quot;: 3.14, # Y coordinate.
229 },
230 ],
231 &quot;vertices&quot;: [ # The bounding polygon vertices.
232 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
233 &quot;x&quot;: 42, # X coordinate.
234 &quot;y&quot;: 42, # Y coordinate.
235 },
236 ],
237 },
238 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
239 &quot;name&quot;: &quot;A String&quot;, # Object name, expressed in its `language_code` language.
240 &quot;score&quot;: 3.14, # Score of the result. Range [0, 1].
241 },
242 ],
243 &quot;context&quot;: { # If an image was produced from a file (e.g. a PDF), this message gives information about the source of that image. # If present, contextual information is needed to understand where this image comes from.
244 &quot;uri&quot;: &quot;A String&quot;, # The URI of the file used to produce the image.
245 &quot;pageNumber&quot;: 42, # If the file was a PDF or TIFF, this field gives the page number within the file used to produce the image.
246 },
247 &quot;logoAnnotations&quot;: [ # If present, logo detection has completed successfully.
248 { # Set of detected entity features.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800249 &quot;locations&quot;: [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks.
250 { # Detected entity location information.
251 &quot;latLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates.
252 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
253 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
254 },
255 },
256 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800257 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1].
258 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of &quot;tower&quot; is likely higher to an image containing the detected &quot;Eiffel Tower&quot; than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1].
259 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800260 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
261 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
262 &quot;x&quot;: 3.14, # X coordinate.
263 &quot;y&quot;: 3.14, # Y coordinate.
264 },
265 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800266 &quot;vertices&quot;: [ # The bounding polygon vertices.
267 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
268 &quot;x&quot;: 42, # X coordinate.
269 &quot;y&quot;: 42, # Y coordinate.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800270 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800271 ],
272 },
273 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
274 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
275 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
276 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity.
277 { # A `Property` consists of a user-supplied name/value pair.
278 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
279 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
280 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800281 },
282 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800283 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual `description` is expressed.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800284 },
285 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800286 &quot;fullTextAnnotation&quot;: { # TextAnnotation contains a structured representation of OCR extracted text. The hierarchy of an OCR extracted text structure is like this: TextAnnotation -&gt; Page -&gt; Block -&gt; Paragraph -&gt; Word -&gt; Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the TextAnnotation.TextProperty message definition below for more detail. # If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800287 &quot;pages&quot;: [ # List of pages detected by OCR.
288 { # Detected page from OCR.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800289 &quot;confidence&quot;: 3.14, # Confidence of the OCR results on the page. Range [0, 1].
290 &quot;height&quot;: 42, # Page height. For PDFs the unit is points. For images (including TIFFs) the unit is pixels.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800291 &quot;blocks&quot;: [ # List of blocks of text, images etc on this page.
292 { # Logical element on the page.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800293 &quot;blockType&quot;: &quot;A String&quot;, # Detected block type (text, image etc) for this block.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800294 &quot;paragraphs&quot;: [ # List of paragraphs in this block (if this blocks is of type text).
295 { # Structural unit of text representing a number of words in certain order.
296 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the paragraph.
297 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
298 { # Detected language for a structural component.
299 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
300 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
301 },
302 ],
303 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
304 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
305 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
306 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800307 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800308 &quot;words&quot;: [ # List of all words in this paragraph.
309 { # A word representation.
310 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the word. Range [0, 1].
311 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the word.
312 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
313 { # Detected language for a structural component.
314 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
315 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
316 },
317 ],
318 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
319 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
320 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
321 },
322 },
323 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the word. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the &#x27;natural&#x27; orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it&#x27;s rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
324 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
325 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
326 &quot;x&quot;: 3.14, # X coordinate.
327 &quot;y&quot;: 3.14, # Y coordinate.
328 },
329 ],
330 &quot;vertices&quot;: [ # The bounding polygon vertices.
331 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
332 &quot;x&quot;: 42, # X coordinate.
333 &quot;y&quot;: 42, # Y coordinate.
334 },
335 ],
336 },
337 &quot;symbols&quot;: [ # List of symbols in the word. The order of the symbols follows the natural reading order.
338 { # A single symbol representation.
339 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the symbol. Range [0, 1].
340 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the symbol.
341 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
342 { # Detected language for a structural component.
343 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
344 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
345 },
346 ],
347 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
348 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
349 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
350 },
351 },
352 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the symbol. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the &#x27;natural&#x27; orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it&#x27;s rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
353 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
354 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
355 &quot;x&quot;: 3.14, # X coordinate.
356 &quot;y&quot;: 3.14, # Y coordinate.
357 },
358 ],
359 &quot;vertices&quot;: [ # The bounding polygon vertices.
360 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
361 &quot;x&quot;: 42, # X coordinate.
362 &quot;y&quot;: 42, # Y coordinate.
363 },
364 ],
365 },
366 &quot;text&quot;: &quot;A String&quot;, # The actual UTF-8 representation of the symbol.
367 },
368 ],
369 },
370 ],
371 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the paragraph. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the &#x27;natural&#x27; orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it&#x27;s rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
372 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
373 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
374 &quot;x&quot;: 3.14, # X coordinate.
375 &quot;y&quot;: 3.14, # Y coordinate.
376 },
377 ],
378 &quot;vertices&quot;: [ # The bounding polygon vertices.
379 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
380 &quot;x&quot;: 42, # X coordinate.
381 &quot;y&quot;: 42, # Y coordinate.
382 },
383 ],
384 },
385 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the paragraph. Range [0, 1].
386 },
387 ],
388 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the &#x27;natural&#x27; orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it&#x27;s rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800389 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
390 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
391 &quot;x&quot;: 3.14, # X coordinate.
392 &quot;y&quot;: 3.14, # Y coordinate.
393 },
394 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800395 &quot;vertices&quot;: [ # The bounding polygon vertices.
396 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
397 &quot;x&quot;: 42, # X coordinate.
398 &quot;y&quot;: 42, # Y coordinate.
399 },
400 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800401 },
402 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the block.
403 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
404 { # Detected language for a structural component.
405 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
406 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
407 },
408 ],
409 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
410 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
411 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
412 },
413 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800414 &quot;confidence&quot;: 3.14, # Confidence of the OCR results on the block. Range [0, 1].
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800415 },
416 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800417 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected on the page.
418 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
419 { # Detected language for a structural component.
420 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
421 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
422 },
423 ],
424 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
425 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
426 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
427 },
428 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800429 &quot;width&quot;: 42, # Page width. For PDFs the unit is points. For images (including TIFFs) the unit is pixels.
430 },
431 ],
432 &quot;text&quot;: &quot;A String&quot;, # UTF-8 text detected on the pages.
433 },
434 &quot;imagePropertiesAnnotation&quot;: { # Stores image properties, such as dominant colors. # If present, image properties were extracted successfully.
435 &quot;dominantColors&quot;: { # Set of dominant colors and their corresponding scores. # If present, dominant colors completed successfully.
436 &quot;colors&quot;: [ # RGB color values with their score and pixel fraction.
437 { # Color information consists of RGB channels, score, and the fraction of the image that the color occupies in the image.
438 &quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot; method in iOS; and, with just a little work, it can be easily formatted into a CSS &quot;rgba()&quot; string in JavaScript, as well. Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space. Note: when color equality needs to be decided, implementations, unless documented otherwise, will treat two colors to be equal if all their red, green, blue and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor_(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # RGB components of the color.
439 &quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: pixel color = alpha * (this color) + (1.0 - alpha) * (background color) This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is to be rendered as a solid color (as if the alpha value had been explicitly given with a value of 1.0).
440 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
441 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
442 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
443 },
444 &quot;pixelFraction&quot;: 3.14, # The fraction of pixels the color occupies in the image. Value in range [0, 1].
445 &quot;score&quot;: 3.14, # Image-specific score for this color. Value in range [0, 1].
446 },
447 ],
448 },
449 },
450 &quot;webDetection&quot;: { # Relevant information for the image from the Internet. # If present, web detection has completed successfully.
451 &quot;fullMatchingImages&quot;: [ # Fully matching images from the Internet. Can include resized copies of the query image.
452 { # Metadata for online images.
453 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
454 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
455 },
456 ],
457 &quot;partialMatchingImages&quot;: [ # Partial matching images from the Internet. Those images are similar enough to share some key-point features. For example an original image will likely have partial matching for its crops.
458 { # Metadata for online images.
459 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
460 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
461 },
462 ],
463 &quot;pagesWithMatchingImages&quot;: [ # Web pages containing the matching images from the Internet.
464 { # Metadata for web pages.
465 &quot;url&quot;: &quot;A String&quot;, # The result web page URL.
466 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the web page.
467 &quot;fullMatchingImages&quot;: [ # Fully matching images on the page. Can include resized copies of the query image.
468 { # Metadata for online images.
469 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
470 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
471 },
472 ],
473 &quot;partialMatchingImages&quot;: [ # Partial matching images on the page. Those images are similar enough to share some key-point features. For example an original image will likely have partial matching for its crops.
474 { # Metadata for online images.
475 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
476 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
477 },
478 ],
479 &quot;pageTitle&quot;: &quot;A String&quot;, # Title for the web page, may contain HTML markups.
480 },
481 ],
482 &quot;bestGuessLabels&quot;: [ # The service&#x27;s best guess as to the topic of the request image. Inferred from similar images on the open web.
483 { # Label to provide extra metadata for the web detection.
484 &quot;label&quot;: &quot;A String&quot;, # Label for extra metadata.
485 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code for `label`, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
486 },
487 ],
488 &quot;visuallySimilarImages&quot;: [ # The visually similar image results.
489 { # Metadata for online images.
490 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
491 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
492 },
493 ],
494 &quot;webEntities&quot;: [ # Deduced entities from similar images on the Internet.
495 { # Entity deduced from similar images on the Internet.
496 &quot;score&quot;: 3.14, # Overall relevancy score for the entity. Not normalized and not comparable across different image queries.
497 &quot;description&quot;: &quot;A String&quot;, # Canonical description of the entity, in English.
498 &quot;entityId&quot;: &quot;A String&quot;, # Opaque entity ID.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800499 },
500 ],
501 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800502 &quot;landmarkAnnotations&quot;: [ # If present, landmark detection has completed successfully.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800503 { # Set of detected entity features.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800504 &quot;locations&quot;: [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks.
505 { # Detected entity location information.
506 &quot;latLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates.
507 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
508 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
509 },
510 },
511 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800512 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1].
513 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of &quot;tower&quot; is likely higher to an image containing the detected &quot;Eiffel Tower&quot; than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1].
514 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features.
515 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
516 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
517 &quot;x&quot;: 3.14, # X coordinate.
518 &quot;y&quot;: 3.14, # Y coordinate.
519 },
520 ],
521 &quot;vertices&quot;: [ # The bounding polygon vertices.
522 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
523 &quot;x&quot;: 42, # X coordinate.
524 &quot;y&quot;: 42, # Y coordinate.
525 },
526 ],
527 },
528 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
529 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
530 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
531 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity.
532 { # A `Property` consists of a user-supplied name/value pair.
533 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
534 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
535 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
536 },
537 ],
538 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual `description` is expressed.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700539 },
540 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800541 &quot;cropHintsAnnotation&quot;: { # Set of crop hints that are used to generate new crops when serving images. # If present, crop hints have completed successfully.
542 &quot;cropHints&quot;: [ # Crop hint results.
543 { # Single crop hint that is used to generate a new crop when serving an image.
544 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the crop region. The coordinates of the bounding box are in the original image&#x27;s scale.
545 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
546 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
547 &quot;x&quot;: 3.14, # X coordinate.
548 &quot;y&quot;: 3.14, # Y coordinate.
549 },
550 ],
551 &quot;vertices&quot;: [ # The bounding polygon vertices.
552 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
553 &quot;x&quot;: 42, # X coordinate.
554 &quot;y&quot;: 42, # Y coordinate.
555 },
556 ],
557 },
558 &quot;importanceFraction&quot;: 3.14, # Fraction of importance of this salient region with respect to the original image.
559 &quot;confidence&quot;: 3.14, # Confidence of this being a salient region. Range [0, 1].
560 },
561 ],
562 },
563 &quot;faceAnnotations&quot;: [ # If present, face detection has completed successfully.
564 { # A face annotation object contains the results of face detection.
565 &quot;panAngle&quot;: 3.14, # Yaw angle, which indicates the leftward/rightward angle that the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180].
566 &quot;detectionConfidence&quot;: 3.14, # Detection confidence. Range [0, 1].
567 &quot;blurredLikelihood&quot;: &quot;A String&quot;, # Blurred likelihood.
568 &quot;landmarks&quot;: [ # Detected face landmarks.
569 { # A face-specific landmark (for example, a face feature).
570 &quot;position&quot;: { # A 3D position in the image, used primarily for Face detection landmarks. A valid Position must have both x and y coordinates. The position coordinates are in the same scale as the original image. # Face landmark position.
571 &quot;x&quot;: 3.14, # X coordinate.
572 &quot;z&quot;: 3.14, # Z coordinate (or depth).
573 &quot;y&quot;: 3.14, # Y coordinate.
574 },
575 &quot;type&quot;: &quot;A String&quot;, # Face landmark type.
576 },
577 ],
578 &quot;surpriseLikelihood&quot;: &quot;A String&quot;, # Surprise likelihood.
579 &quot;headwearLikelihood&quot;: &quot;A String&quot;, # Headwear likelihood.
580 &quot;rollAngle&quot;: 3.14, # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180].
581 &quot;landmarkingConfidence&quot;: 3.14, # Face landmarking confidence. Range [0, 1].
582 &quot;joyLikelihood&quot;: &quot;A String&quot;, # Joy likelihood.
583 &quot;fdBoundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that detects the &quot;amount of skin&quot; visible in an image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix.
584 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
585 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
586 &quot;x&quot;: 3.14, # X coordinate.
587 &quot;y&quot;: 3.14, # Y coordinate.
588 },
589 ],
590 &quot;vertices&quot;: [ # The bounding polygon vertices.
591 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
592 &quot;x&quot;: 42, # X coordinate.
593 &quot;y&quot;: 42, # Y coordinate.
594 },
595 ],
596 },
597 &quot;underExposedLikelihood&quot;: &quot;A String&quot;, # Under-exposed likelihood.
598 &quot;angerLikelihood&quot;: &quot;A String&quot;, # Anger likelihood.
599 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the face. The coordinates of the bounding box are in the original image&#x27;s scale. The bounding box is computed to &quot;frame&quot; the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the `BoundingPoly` (the polygon will be unbounded) if only a partial face appears in the image to be annotated.
600 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
601 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
602 &quot;x&quot;: 3.14, # X coordinate.
603 &quot;y&quot;: 3.14, # Y coordinate.
604 },
605 ],
606 &quot;vertices&quot;: [ # The bounding polygon vertices.
607 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
608 &quot;x&quot;: 42, # X coordinate.
609 &quot;y&quot;: 42, # Y coordinate.
610 },
611 ],
612 },
613 &quot;tiltAngle&quot;: 3.14, # Pitch angle, which indicates the upwards/downwards angle that the face is pointing relative to the image&#x27;s horizontal plane. Range [-180,180].
614 &quot;sorrowLikelihood&quot;: &quot;A String&quot;, # Sorrow likelihood.
615 },
616 ],
617 &quot;productSearchResults&quot;: { # Results for a product search request. # If present, product search has completed successfully.
618 &quot;results&quot;: [ # List of results, one for each product match.
619 { # Information about a product.
620 &quot;image&quot;: &quot;A String&quot;, # The resource name of the image from the product that is the closest match to the query.
621 &quot;score&quot;: 3.14, # A confidence level on the match, ranging from 0 (no confidence) to 1 (full confidence).
622 &quot;product&quot;: { # A Product contains ReferenceImages. # The Product.
623 &quot;productCategory&quot;: &quot;A String&quot;, # Immutable. The category for the product identified by the reference image. This should be one of &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;, &quot;packagedgoods-v1&quot; or &quot;general-v1&quot;. The legacy categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported, but these should not be used for new products.
624 &quot;name&quot;: &quot;A String&quot;, # The resource name of the product. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product.
625 &quot;productLabels&quot;: [ # Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. &quot;1199&quot;. Only strings with integer values can match a range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product may have up to 500 product_labels. Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.
626 { # A product label represented as a key-value pair.
627 &quot;value&quot;: &quot;A String&quot;, # The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes.
628 &quot;key&quot;: &quot;A String&quot;, # The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes.
629 },
630 ],
631 &quot;displayName&quot;: &quot;A String&quot;, # The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.
632 &quot;description&quot;: &quot;A String&quot;, # User-provided metadata to be stored with this product. Must be at most 4096 characters long.
633 },
634 },
635 ],
636 &quot;indexTime&quot;: &quot;A String&quot;, # Timestamp of the index which provided these results. Products added to the product set and products removed from the product set after this time are not reflected in the current results.
637 &quot;productGroupedResults&quot;: [ # List of results grouped by products detected in the query image. Each entry corresponds to one bounding polygon in the query image, and contains the matching products specific to that region. There may be duplicate product matches in the union of all the per-product results.
638 { # Information about the products similar to a single product in a query image.
639 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the product detected in the query image.
640 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
641 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
642 &quot;x&quot;: 3.14, # X coordinate.
643 &quot;y&quot;: 3.14, # Y coordinate.
644 },
645 ],
646 &quot;vertices&quot;: [ # The bounding polygon vertices.
647 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
648 &quot;x&quot;: 42, # X coordinate.
649 &quot;y&quot;: 42, # Y coordinate.
650 },
651 ],
652 },
653 &quot;objectAnnotations&quot;: [ # List of generic predictions for the object in the bounding box.
654 { # Prediction for what the object in the bounding box is.
655 &quot;mid&quot;: &quot;A String&quot;, # Object ID that should align with EntityAnnotation mid.
656 &quot;name&quot;: &quot;A String&quot;, # Object name, expressed in its `language_code` language.
657 &quot;score&quot;: 3.14, # Score of the result. Range [0, 1].
658 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
659 },
660 ],
661 &quot;results&quot;: [ # List of results, one for each product match.
662 { # Information about a product.
663 &quot;image&quot;: &quot;A String&quot;, # The resource name of the image from the product that is the closest match to the query.
664 &quot;score&quot;: 3.14, # A confidence level on the match, ranging from 0 (no confidence) to 1 (full confidence).
665 &quot;product&quot;: { # A Product contains ReferenceImages. # The Product.
666 &quot;productCategory&quot;: &quot;A String&quot;, # Immutable. The category for the product identified by the reference image. This should be one of &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;, &quot;packagedgoods-v1&quot; or &quot;general-v1&quot;. The legacy categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported, but these should not be used for new products.
667 &quot;name&quot;: &quot;A String&quot;, # The resource name of the product. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product.
668 &quot;productLabels&quot;: [ # Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. &quot;1199&quot;. Only strings with integer values can match a range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product may have up to 500 product_labels. Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.
669 { # A product label represented as a key-value pair.
670 &quot;value&quot;: &quot;A String&quot;, # The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes.
671 &quot;key&quot;: &quot;A String&quot;, # The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes.
672 },
673 ],
674 &quot;displayName&quot;: &quot;A String&quot;, # The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.
675 &quot;description&quot;: &quot;A String&quot;, # User-provided metadata to be stored with this product. Must be at most 4096 characters long.
676 },
677 },
678 ],
679 },
680 ],
681 },
682 &quot;labelAnnotations&quot;: [ # If present, label detection has completed successfully.
683 { # Set of detected entity features.
684 &quot;locations&quot;: [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks.
685 { # Detected entity location information.
686 &quot;latLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates.
687 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
688 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
689 },
690 },
691 ],
692 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1].
693 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of &quot;tower&quot; is likely higher to an image containing the detected &quot;Eiffel Tower&quot; than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1].
694 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features.
695 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
696 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
697 &quot;x&quot;: 3.14, # X coordinate.
698 &quot;y&quot;: 3.14, # Y coordinate.
699 },
700 ],
701 &quot;vertices&quot;: [ # The bounding polygon vertices.
702 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
703 &quot;x&quot;: 42, # X coordinate.
704 &quot;y&quot;: 42, # Y coordinate.
705 },
706 ],
707 },
708 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
709 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
710 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
711 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity.
712 { # A `Property` consists of a user-supplied name/value pair.
713 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
714 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
715 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
716 },
717 ],
718 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual `description` is expressed.
719 },
720 ],
721 &quot;safeSearchAnnotation&quot;: { # Set of features pertaining to the image, computed by computer vision methods over safe-search verticals (for example, adult, spoof, medical, violence). # If present, safe-search annotation has completed successfully.
722 &quot;adult&quot;: &quot;A String&quot;, # Represents the adult content likelihood for the image. Adult content may contain elements such as nudity, pornographic images or cartoons, or sexual activities.
723 &quot;violence&quot;: &quot;A String&quot;, # Likelihood that this image contains violent content.
724 &quot;spoof&quot;: &quot;A String&quot;, # Spoof likelihood. The likelihood that an modification was made to the image&#x27;s canonical version to make it appear funny or offensive.
725 &quot;racy&quot;: &quot;A String&quot;, # Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas.
726 &quot;medical&quot;: &quot;A String&quot;, # Likelihood that this is a medical image.
727 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700728 },
729 ],
730 }</pre>
731</div>
732
733<div class="method">
734 <code class="details" id="asyncBatchAnnotate">asyncBatchAnnotate(parent, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700735 <pre>Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
Bu Sun Kim65020912020-05-20 12:08:20 -0700736
737Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700738 parent: string, Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700739 body: object, The request body.
740 The object takes the form of:
741
742{ # Request for async image annotation for a list of images.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800743 &quot;parent&quot;: &quot;A String&quot;, # Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700744 &quot;requests&quot;: [ # Required. Individual image annotation requests for this batch.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700745 { # Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700746 &quot;imageContext&quot;: { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800747 &quot;languageHints&quot;: [ # 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).
748 &quot;A String&quot;,
749 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800750 &quot;latLongRect&quot;: { # Rectangle determined by min and max `LatLng` pairs. # Not used.
751 &quot;minLatLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # Min lat/long pair.
752 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
753 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
754 },
755 &quot;maxLatLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. # Max lat/long pair.
756 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
757 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
758 },
759 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700760 &quot;cropHintsParams&quot;: { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
761 &quot;aspectRatios&quot;: [ # Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.
762 3.14,
763 ],
764 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800765 &quot;webDetectionParams&quot;: { # Parameters for web detection request. # Parameters for web detection.
766 &quot;includeGeoResults&quot;: True or False, # Whether to include results derived from the geo information in the image.
767 },
768 &quot;productSearchParams&quot;: { # Parameters for a product search request. # Parameters for product search.
769 &quot;filter&quot;: &quot;A String&quot;, # The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An &#x27;=&#x27; should be used to connect the key and value. For example, &quot;(color = red OR color = blue) AND brand = Google&quot; is acceptable, but &quot;(color = red OR brand = Google)&quot; is not acceptable. &quot;color: red&quot; is not acceptable because it uses a &#x27;:&#x27; instead of an &#x27;=&#x27;.
770 &quot;productCategories&quot;: [ # The list of product categories to search in. Currently, we only consider the first category, and either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;, &quot;packagedgoods-v1&quot;, or &quot;general-v1&quot; should be specified. The legacy categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported but will be deprecated. For new products, please use &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, or &quot;toys-v2&quot; for better product search accuracy. It is recommended to migrate existing products to these categories as well.
771 &quot;A String&quot;,
772 ],
773 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
774 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
775 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
776 &quot;x&quot;: 3.14, # X coordinate.
777 &quot;y&quot;: 3.14, # Y coordinate.
778 },
779 ],
780 &quot;vertices&quot;: [ # The bounding polygon vertices.
781 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
782 &quot;x&quot;: 42, # X coordinate.
783 &quot;y&quot;: 42, # Y coordinate.
784 },
785 ],
786 },
787 &quot;productSet&quot;: &quot;A String&quot;, # The resource name of a ProductSet to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
788 },
789 },
790 &quot;image&quot;: { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
791 &quot;content&quot;: &quot;A String&quot;, # Image content, represented as a stream of bytes. Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests.
792 &quot;source&quot;: { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image URL. If both `content` and `source` are provided for an image, `content` takes precedence and is used to perform the image annotation request.
793 &quot;imageUri&quot;: &quot;A String&quot;, # The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from HTTP/HTTPS URLs, Google cannot guarantee that the request will be completed. Your request may fail if the specified host denies the request (e.g. due to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes precedence.
794 &quot;gcsImageUri&quot;: &quot;A String&quot;, # **Use `image_uri` instead.** The Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
795 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700796 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800797 &quot;features&quot;: [ # Requested features.
798 { # The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple `Feature` objects can be specified in the `features` list.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800799 &quot;maxResults&quot;: 42, # Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800800 &quot;model&quot;: &quot;A String&quot;, # Model to use for the feature. Supported values: &quot;builtin/stable&quot; (the default if unset) and &quot;builtin/latest&quot;.
801 &quot;type&quot;: &quot;A String&quot;, # The feature type.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800802 },
803 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700804 },
805 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700806 &quot;outputConfig&quot;: { # The desired output location and metadata. # Required. The desired output location and metadata (e.g. format).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700807 &quot;gcsDestination&quot;: { # The Google Cloud Storage location where the output will be written to. # The Google Cloud Storage location to write the output(s) to.
808 &quot;uri&quot;: &quot;A String&quot;, # Google Cloud Storage URI prefix where the results will be stored. Results will be in JSON format and preceded by its corresponding input URI prefix. This field can either represent a gcs file prefix or gcs directory. In either case, the uri should be unique because in order to get all of the output files, you will need to do a wildcard gcs search on the uri prefix you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with &quot;filenameprefix&quot;. * Directory Prefix: gs://bucket-name/some/location/ The output files will be created in gs://bucket-name/some/location/ and the names of the output files could be anything because there was no filename prefix specified. If multiple outputs, each response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and overflows into multiple sharded files.
809 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700810 &quot;batchSize&quot;: 42, # The max number of response protos to put into each output JSON file on Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response protos will be generated. If `batch_size` = 20, then 5 json files each containing 20 response protos will be written under the prefix `gcs_destination`.`uri`. Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700811 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700812 }
813
814 x__xgafv: string, V1 error format.
815 Allowed values
816 1 - v1 error format
817 2 - v2 error format
818
819Returns:
820 An object of the form:
821
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700822 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800823 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700824 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700825 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700826 {
827 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
828 },
829 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800830 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700831 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700832 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800833 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
834 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
835 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
836 },
837 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
838 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
839 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700840 }</pre>
841</div>
842
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700843<div class="method">
844 <code class="details" id="close">close()</code>
845 <pre>Close httplib2 connections.</pre>
846</div>
847
Bu Sun Kim65020912020-05-20 12:08:20 -0700848</body></html>