blob: c3e764f79bfe7c362562e972d69bde71a38a9b24 [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>
82<p class="firstline">Run asynchronous image detection and annotation for a list of images.</p>
83<h3>Method Details</h3>
84<div class="method">
85 <code class="details" id="annotate">annotate(parent, body=None, x__xgafv=None)</code>
86 <pre>Run image detection and annotation for a batch of images.
87
88Args:
89 parent: string, Optional. Target project and location to make a call.
90
91Format: `projects/{project-id}/locations/{location-id}`.
92
93If no parent is specified, a region will be chosen automatically.
94
95Supported location-ids:
96 `us`: USA country only,
97 `asia`: East asia areas, like Japan, Taiwan,
98 `eu`: The European Union.
99
100Example: `projects/project-A/locations/eu`. (required)
101 body: object, The request body.
102 The object takes the form of:
103
104{ # Multiple image annotation requests are batched into a single service call.
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 &quot;requests&quot;: [ # Required. Individual image annotation requests for this batch.
106 { # Request for performing Google Cloud Vision API tasks over a user-provided
107 # image, with user-requested features, and with context information.
108 &quot;image&quot;: { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
109 &quot;content&quot;: &quot;A String&quot;, # Image content, represented as a stream of bytes.
110 # Note: As with all `bytes` fields, protobuffers use a pure binary
111 # representation, whereas JSON representations use base64.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700112 #
113 # Currently, this field only works for BatchAnnotateImages requests. It does
114 # not work for AsyncBatchAnnotateImages requests.
Bu Sun Kim65020912020-05-20 12:08:20 -0700115 &quot;source&quot;: { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image
116 # URL. If both `content` and `source` are provided for an image, `content`
117 # takes precedence and is used to perform the image annotation request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700118 &quot;gcsImageUri&quot;: &quot;A String&quot;, # **Use `image_uri` instead.**
119 #
120 # The Google Cloud Storage URI of the form
121 # `gs://bucket_name/object_name`. Object versioning is not supported. See
122 # [Google Cloud Storage Request
123 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
Bu Sun Kim65020912020-05-20 12:08:20 -0700124 &quot;imageUri&quot;: &quot;A String&quot;, # The URI of the source image. Can be either:
125 #
126 # 1. A Google Cloud Storage URI of the form
127 # `gs://bucket_name/object_name`. Object versioning is not supported. See
128 # [Google Cloud Storage Request
129 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
130 # info.
131 #
132 # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
133 # HTTP/HTTPS URLs, Google cannot guarantee that the request will be
134 # completed. Your request may fail if the specified host denies the
135 # request (e.g. due to request throttling or DOS prevention), or if Google
136 # throttles requests to the site for abuse prevention. You should not
137 # depend on externally-hosted images for production applications.
138 #
139 # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
140 # precedence.
Bu Sun Kim65020912020-05-20 12:08:20 -0700141 },
142 },
143 &quot;features&quot;: [ # Requested features.
144 { # The type of Google Cloud Vision API detection to perform, and the maximum
145 # number of results to return for that type. Multiple `Feature` objects can
146 # be specified in the `features` list.
147 &quot;type&quot;: &quot;A String&quot;, # The feature type.
148 &quot;maxResults&quot;: 42, # Maximum number of results of this type. Does not apply to
149 # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
150 &quot;model&quot;: &quot;A String&quot;, # Model to use for the feature.
151 # Supported values: &quot;builtin/stable&quot; (the default if unset) and
152 # &quot;builtin/latest&quot;.
153 },
154 ],
155 &quot;imageContext&quot;: { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700156 &quot;cropHintsParams&quot;: { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
157 &quot;aspectRatios&quot;: [ # Aspect ratios in floats, representing the ratio of the width to the height
158 # of the image. For example, if the desired aspect ratio is 4/3, the
159 # corresponding float value should be 1.33333. If not specified, the
160 # best possible crop is returned. The number of provided aspect ratios is
161 # limited to a maximum of 16; any aspect ratios provided after the 16th are
162 # ignored.
163 3.14,
164 ],
165 },
166 &quot;productSearchParams&quot;: { # Parameters for a product search request. # Parameters for product search.
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 &quot;productCategories&quot;: [ # The list of product categories to search in. Currently, we only consider
168 # the first category, and either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;,
169 # &quot;packagedgoods-v1&quot;, or &quot;general-v1&quot; should be specified. The legacy
170 # categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported but will
171 # be deprecated. For new products, please use &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;,
172 # or &quot;toys-v2&quot; for better product search accuracy. It is recommended to
173 # migrate existing products to these categories as well.
174 &quot;A String&quot;,
175 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700176 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image.
177 # If it is not specified, system discretion will be applied.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700178 &quot;vertices&quot;: [ # The bounding polygon vertices.
179 { # A vertex represents a 2D point in the image.
180 # NOTE: the vertex coordinates are in the same scale as the original image.
181 &quot;x&quot;: 42, # X coordinate.
182 &quot;y&quot;: 42, # Y coordinate.
183 },
184 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700185 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
186 { # A vertex represents a 2D point in the image.
187 # NOTE: the normalized vertex coordinates are relative to the original image
188 # and range from 0 to 1.
189 &quot;x&quot;: 3.14, # X coordinate.
190 &quot;y&quot;: 3.14, # Y coordinate.
191 },
192 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700193 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700194 &quot;productSet&quot;: &quot;A String&quot;, # The resource name of a ProductSet to be searched for similar images.
195 #
196 # Format is:
197 # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
198 &quot;filter&quot;: &quot;A String&quot;, # The filtering expression. This can be used to restrict search results based
199 # on Product labels. We currently support an AND of OR of key-value
200 # expressions, where each expression within an OR must have the same key. An
201 # &#x27;=&#x27; should be used to connect the key and value.
202 #
203 # For example, &quot;(color = red OR color = blue) AND brand = Google&quot; is
204 # acceptable, but &quot;(color = red OR brand = Google)&quot; is not acceptable.
205 # &quot;color: red&quot; is not acceptable because it uses a &#x27;:&#x27; instead of an &#x27;=&#x27;.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700206 },
207 &quot;languageHints&quot;: [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
208 # yields the best results since it enables automatic language detection. For
209 # languages based on the Latin alphabet, setting `language_hints` is not
210 # needed. In rare cases, when the language of the text in the image is known,
211 # setting a hint will help get better results (although it will be a
212 # significant hindrance if the hint is wrong). Text detection returns an
213 # error if one or more of the specified languages is not one of the
214 # [supported languages](https://cloud.google.com/vision/docs/languages).
215 &quot;A String&quot;,
216 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700217 &quot;latLongRect&quot;: { # Rectangle determined by min and max `LatLng` pairs. # Not used.
218 &quot;maxLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Max lat/long pair.
219 # of doubles representing degrees latitude and degrees longitude. Unless
220 # specified otherwise, this must conform to the
221 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
222 # standard&lt;/a&gt;. Values must be within normalized ranges.
223 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
224 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
225 },
226 &quot;minLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Min lat/long pair.
227 # of doubles representing degrees latitude and degrees longitude. Unless
228 # specified otherwise, this must conform to the
229 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
230 # standard&lt;/a&gt;. Values must be within normalized ranges.
231 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
232 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
233 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700234 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700235 &quot;webDetectionParams&quot;: { # Parameters for web detection request. # Parameters for web detection.
236 &quot;includeGeoResults&quot;: True or False, # Whether to include results derived from the geo information in the image.
237 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700238 },
239 },
240 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700241 &quot;parent&quot;: &quot;A String&quot;, # Optional. Target project and location to make a call.
242 #
243 # Format: `projects/{project-id}/locations/{location-id}`.
244 #
245 # If no parent is specified, a region will be chosen automatically.
246 #
247 # Supported location-ids:
248 # `us`: USA country only,
249 # `asia`: East asia areas, like Japan, Taiwan,
250 # `eu`: The European Union.
251 #
252 # Example: `projects/project-A/locations/eu`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700253 }
254
255 x__xgafv: string, V1 error format.
256 Allowed values
257 1 - v1 error format
258 2 - v2 error format
259
260Returns:
261 An object of the form:
262
263 { # Response to a batch image annotation request.
264 &quot;responses&quot;: [ # Individual responses to image annotation requests within the batch.
265 { # Response to an image annotation request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700266 &quot;productSearchResults&quot;: { # Results for a product search request. # If present, product search has completed successfully.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700267 &quot;indexTime&quot;: &quot;A String&quot;, # Timestamp of the index which provided these results. Products added to the
268 # product set and products removed from the product set after this time are
269 # not reflected in the current results.
Bu Sun Kim65020912020-05-20 12:08:20 -0700270 &quot;results&quot;: [ # List of results, one for each product match.
271 { # Information about a product.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700272 &quot;score&quot;: 3.14, # A confidence level on the match, ranging from 0 (no confidence) to
273 # 1 (full confidence).
Bu Sun Kim65020912020-05-20 12:08:20 -0700274 &quot;image&quot;: &quot;A String&quot;, # The resource name of the image from the product that is the closest match
275 # to the query.
276 &quot;product&quot;: { # A Product contains ReferenceImages. # The Product.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700277 &quot;displayName&quot;: &quot;A String&quot;, # The user-provided name for this Product. Must not be empty. Must be at most
278 # 4096 characters long.
279 &quot;name&quot;: &quot;A String&quot;, # The resource name of the product.
280 #
281 # Format is:
282 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
283 #
284 # This field is ignored when creating a product.
285 &quot;description&quot;: &quot;A String&quot;, # User-provided metadata to be stored with this product. Must be at most 4096
286 # characters long.
287 &quot;productCategory&quot;: &quot;A String&quot;, # Immutable. The category for the product identified by the reference image. This should
288 # be either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, or &quot;toys-v2&quot;. The legacy categories
289 # &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported, but these should
290 # not be used for new products.
Bu Sun Kim65020912020-05-20 12:08:20 -0700291 &quot;productLabels&quot;: [ # Key-value pairs that can be attached to a product. At query time,
292 # constraints can be specified based on the product_labels.
293 #
294 # Note that integer values can be provided as strings, e.g. &quot;1199&quot;. Only
295 # strings with integer values can match a range-based restriction which is
296 # to be supported soon.
297 #
298 # Multiple values can be assigned to the same key. One product may have up to
299 # 500 product_labels.
300 #
301 # Notice that the total number of distinct product_labels over all products
302 # in one ProductSet cannot exceed 1M, otherwise the product search pipeline
303 # will refuse to work for that ProductSet.
304 { # A product label represented as a key-value pair.
Bu Sun Kim65020912020-05-20 12:08:20 -0700305 &quot;key&quot;: &quot;A String&quot;, # The key of the label attached to the product. Cannot be empty and cannot
306 # exceed 128 bytes.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700307 &quot;value&quot;: &quot;A String&quot;, # The value of the label attached to the product. Cannot be empty and
308 # cannot exceed 128 bytes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700309 },
310 ],
311 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700312 },
313 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700314 &quot;productGroupedResults&quot;: [ # List of results grouped by products detected in the query image. Each entry
315 # corresponds to one bounding polygon in the query image, and contains the
316 # matching products specific to that region. There may be duplicate product
317 # matches in the union of all the per-product results.
318 { # Information about the products similar to a single product in a query
319 # image.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700320 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the product detected in the query image.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700321 &quot;vertices&quot;: [ # The bounding polygon vertices.
322 { # A vertex represents a 2D point in the image.
323 # NOTE: the vertex coordinates are in the same scale as the original image.
324 &quot;x&quot;: 42, # X coordinate.
325 &quot;y&quot;: 42, # Y coordinate.
326 },
327 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700328 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
329 { # A vertex represents a 2D point in the image.
330 # NOTE: the normalized vertex coordinates are relative to the original image
331 # and range from 0 to 1.
332 &quot;x&quot;: 3.14, # X coordinate.
333 &quot;y&quot;: 3.14, # Y coordinate.
334 },
335 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700336 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700337 &quot;objectAnnotations&quot;: [ # List of generic predictions for the object in the bounding box.
338 { # Prediction for what the object in the bounding box is.
339 &quot;score&quot;: 3.14, # Score of the result. Range [0, 1].
340 &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
341 # information, see
342 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
343 &quot;mid&quot;: &quot;A String&quot;, # Object ID that should align with EntityAnnotation mid.
344 &quot;name&quot;: &quot;A String&quot;, # Object name, expressed in its `language_code` language.
345 },
346 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700347 &quot;results&quot;: [ # List of results, one for each product match.
348 { # Information about a product.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700349 &quot;score&quot;: 3.14, # A confidence level on the match, ranging from 0 (no confidence) to
350 # 1 (full confidence).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700351 &quot;image&quot;: &quot;A String&quot;, # The resource name of the image from the product that is the closest match
352 # to the query.
353 &quot;product&quot;: { # A Product contains ReferenceImages. # The Product.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700354 &quot;displayName&quot;: &quot;A String&quot;, # The user-provided name for this Product. Must not be empty. Must be at most
355 # 4096 characters long.
356 &quot;name&quot;: &quot;A String&quot;, # The resource name of the product.
357 #
358 # Format is:
359 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
360 #
361 # This field is ignored when creating a product.
362 &quot;description&quot;: &quot;A String&quot;, # User-provided metadata to be stored with this product. Must be at most 4096
363 # characters long.
364 &quot;productCategory&quot;: &quot;A String&quot;, # Immutable. The category for the product identified by the reference image. This should
365 # be either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, or &quot;toys-v2&quot;. The legacy categories
366 # &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported, but these should
367 # not be used for new products.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700368 &quot;productLabels&quot;: [ # Key-value pairs that can be attached to a product. At query time,
369 # constraints can be specified based on the product_labels.
370 #
371 # Note that integer values can be provided as strings, e.g. &quot;1199&quot;. Only
372 # strings with integer values can match a range-based restriction which is
373 # to be supported soon.
374 #
375 # Multiple values can be assigned to the same key. One product may have up to
376 # 500 product_labels.
377 #
378 # Notice that the total number of distinct product_labels over all products
379 # in one ProductSet cannot exceed 1M, otherwise the product search pipeline
380 # will refuse to work for that ProductSet.
381 { # A product label represented as a key-value pair.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700382 &quot;key&quot;: &quot;A String&quot;, # The key of the label attached to the product. Cannot be empty and cannot
383 # exceed 128 bytes.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700384 &quot;value&quot;: &quot;A String&quot;, # The value of the label attached to the product. Cannot be empty and
385 # cannot exceed 128 bytes.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700386 },
387 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700388 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700389 },
390 ],
391 },
392 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700393 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700394 &quot;textAnnotations&quot;: [ # If present, text (OCR) detection has completed successfully.
395 { # Set of detected entity features.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700396 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
397 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
398 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
399 # detected distant towering building, even though the confidence that
400 # there is a tower in each image may be the same. Range [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700401 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
402 # `description` is expressed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700403 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
404 # `LocationInfo` elements can be present because one location may
405 # indicate the location of the scene in the image, and another location
406 # may indicate the location of the place where the image was taken.
407 # Location information is usually present for landmarks.
408 { # Detected entity location information.
409 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
410 # of doubles representing degrees latitude and degrees longitude. Unless
411 # specified otherwise, this must conform to the
412 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
413 # standard&lt;/a&gt;. Values must be within normalized ranges.
414 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
415 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
416 },
417 },
418 ],
419 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
420 # [Google Knowledge Graph Search
421 # API](https://developers.google.com/knowledge-graph/).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700422 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
Bu Sun Kim65020912020-05-20 12:08:20 -0700423 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
424 # The accuracy of the entity detection in an image.
425 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
426 # this field represents the confidence that there is a tower in the query
427 # image. Range [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700428 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
429 # for `LABEL_DETECTION` features.
430 &quot;vertices&quot;: [ # The bounding polygon vertices.
431 { # A vertex represents a 2D point in the image.
432 # NOTE: the vertex coordinates are in the same scale as the original image.
433 &quot;x&quot;: 42, # X coordinate.
434 &quot;y&quot;: 42, # Y coordinate.
435 },
436 ],
437 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
438 { # A vertex represents a 2D point in the image.
439 # NOTE: the normalized vertex coordinates are relative to the original image
440 # and range from 0 to 1.
441 &quot;x&quot;: 3.14, # X coordinate.
442 &quot;y&quot;: 3.14, # Y coordinate.
443 },
444 ],
445 },
446 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
447 # fields, such a score or string that qualifies the entity.
448 { # A `Property` consists of a user-supplied name/value pair.
449 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
450 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
451 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
452 },
453 ],
454 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700455 },
456 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700457 &quot;safeSearchAnnotation&quot;: { # Set of features pertaining to the image, computed by computer vision # If present, safe-search annotation has completed successfully.
458 # methods over safe-search verticals (for example, adult, spoof, medical,
459 # violence).
460 &quot;racy&quot;: &quot;A String&quot;, # Likelihood that the request image contains racy content. Racy content may
461 # include (but is not limited to) skimpy or sheer clothing, strategically
462 # covered nudity, lewd or provocative poses, or close-ups of sensitive
463 # body areas.
464 &quot;medical&quot;: &quot;A String&quot;, # Likelihood that this is a medical image.
465 &quot;adult&quot;: &quot;A String&quot;, # Represents the adult content likelihood for the image. Adult content may
466 # contain elements such as nudity, pornographic images or cartoons, or
467 # sexual activities.
468 &quot;violence&quot;: &quot;A String&quot;, # Likelihood that this image contains violent content.
469 &quot;spoof&quot;: &quot;A String&quot;, # Spoof likelihood. The likelihood that an modification
470 # was made to the image&#x27;s canonical version to make it appear
471 # funny or offensive.
472 },
473 &quot;webDetection&quot;: { # Relevant information for the image from the Internet. # If present, web detection has completed successfully.
474 &quot;fullMatchingImages&quot;: [ # Fully matching images from the Internet.
475 # Can include resized copies of the query image.
476 { # Metadata for online images.
477 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
478 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
479 },
480 ],
481 &quot;bestGuessLabels&quot;: [ # The service&#x27;s best guess as to the topic of the request image.
482 # Inferred from similar images on the open web.
483 { # Label to provide extra metadata for the web detection.
484 &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;.
485 # For more information, see
486 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
487 &quot;label&quot;: &quot;A String&quot;, # Label for extra metadata.
488 },
489 ],
490 &quot;visuallySimilarImages&quot;: [ # The visually similar image results.
491 { # Metadata for online images.
492 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
493 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
494 },
495 ],
496 &quot;partialMatchingImages&quot;: [ # Partial matching images from the Internet.
497 # Those images are similar enough to share some key-point features. For
498 # example an original image will likely have partial matching for its crops.
499 { # Metadata for online images.
500 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
501 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
502 },
503 ],
504 &quot;webEntities&quot;: [ # Deduced entities from similar images on the Internet.
505 { # Entity deduced from similar images on the Internet.
506 &quot;entityId&quot;: &quot;A String&quot;, # Opaque entity ID.
507 &quot;score&quot;: 3.14, # Overall relevancy score for the entity.
508 # Not normalized and not comparable across different image queries.
509 &quot;description&quot;: &quot;A String&quot;, # Canonical description of the entity, in English.
510 },
511 ],
512 &quot;pagesWithMatchingImages&quot;: [ # Web pages containing the matching images from the Internet.
513 { # Metadata for web pages.
514 &quot;partialMatchingImages&quot;: [ # Partial matching images on the page.
515 # Those images are similar enough to share some key-point features. For
516 # example an original image will likely have partial matching for its
517 # crops.
518 { # Metadata for online images.
519 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
520 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
521 },
522 ],
523 &quot;url&quot;: &quot;A String&quot;, # The result web page URL.
524 &quot;fullMatchingImages&quot;: [ # Fully matching images on the page.
525 # Can include resized copies of the query image.
526 { # Metadata for online images.
527 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
528 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
529 },
530 ],
531 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the web page.
532 &quot;pageTitle&quot;: &quot;A String&quot;, # Title for the web page, may contain HTML markups.
533 },
534 ],
535 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700536 &quot;imagePropertiesAnnotation&quot;: { # Stores image properties, such as dominant colors. # If present, image properties were extracted successfully.
537 &quot;dominantColors&quot;: { # Set of dominant colors and their corresponding scores. # If present, dominant colors completed successfully.
538 &quot;colors&quot;: [ # RGB color values with their score and pixel fraction.
539 { # Color information consists of RGB channels, score, and the fraction of
540 # the image that the color occupies in the image.
541 &quot;pixelFraction&quot;: 3.14, # The fraction of pixels the color occupies in the image.
542 # Value in range [0, 1].
543 &quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed # RGB components of the color.
544 # for simplicity of conversion to/from color representations in various
545 # languages over compactness; for example, the fields of this representation
546 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
547 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
548 # method in iOS; and, with just a little work, it can be easily formatted into
549 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
550 #
551 # Note: this proto does not carry information about the absolute color space
552 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
553 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
554 # space.
555 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700556 # Note: when color equality needs to be decided, implementations, unless
557 # documented otherwise, will treat two colors to be equal if all their red,
558 # green, blue and alpha values each differ by at most 1e-5.
559 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700560 # Example (Java):
561 #
562 # import com.google.type.Color;
563 #
564 # // ...
565 # public static java.awt.Color fromProto(Color protocolor) {
566 # float alpha = protocolor.hasAlpha()
567 # ? protocolor.getAlpha().getValue()
568 # : 1.0;
569 #
570 # return new java.awt.Color(
571 # protocolor.getRed(),
572 # protocolor.getGreen(),
573 # protocolor.getBlue(),
574 # alpha);
575 # }
576 #
577 # public static Color toProto(java.awt.Color color) {
578 # float red = (float) color.getRed();
579 # float green = (float) color.getGreen();
580 # float blue = (float) color.getBlue();
581 # float denominator = 255.0;
582 # Color.Builder resultBuilder =
583 # Color
584 # .newBuilder()
585 # .setRed(red / denominator)
586 # .setGreen(green / denominator)
587 # .setBlue(blue / denominator);
588 # int alpha = color.getAlpha();
589 # if (alpha != 255) {
590 # result.setAlpha(
591 # FloatValue
592 # .newBuilder()
593 # .setValue(((float) alpha) / denominator)
594 # .build());
595 # }
596 # return resultBuilder.build();
597 # }
598 # // ...
599 #
600 # Example (iOS / Obj-C):
601 #
602 # // ...
603 # static UIColor* fromProto(Color* protocolor) {
604 # float red = [protocolor red];
605 # float green = [protocolor green];
606 # float blue = [protocolor blue];
607 # FloatValue* alpha_wrapper = [protocolor alpha];
608 # float alpha = 1.0;
609 # if (alpha_wrapper != nil) {
610 # alpha = [alpha_wrapper value];
611 # }
612 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
613 # }
614 #
615 # static Color* toProto(UIColor* color) {
616 # CGFloat red, green, blue, alpha;
617 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
618 # return nil;
619 # }
620 # Color* result = [[Color alloc] init];
621 # [result setRed:red];
622 # [result setGreen:green];
623 # [result setBlue:blue];
624 # if (alpha &lt;= 0.9999) {
625 # [result setAlpha:floatWrapperWithValue(alpha)];
626 # }
627 # [result autorelease];
628 # return result;
629 # }
630 # // ...
631 #
632 # Example (JavaScript):
633 #
634 # // ...
635 #
636 # var protoToCssColor = function(rgb_color) {
637 # var redFrac = rgb_color.red || 0.0;
638 # var greenFrac = rgb_color.green || 0.0;
639 # var blueFrac = rgb_color.blue || 0.0;
640 # var red = Math.floor(redFrac * 255);
641 # var green = Math.floor(greenFrac * 255);
642 # var blue = Math.floor(blueFrac * 255);
643 #
644 # if (!(&#x27;alpha&#x27; in rgb_color)) {
645 # return rgbToCssColor_(red, green, blue);
646 # }
647 #
648 # var alphaFrac = rgb_color.alpha.value || 0.0;
649 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
650 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
651 # };
652 #
653 # var rgbToCssColor_ = function(red, green, blue) {
654 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
655 # var hexString = rgbNumber.toString(16);
656 # var missingZeros = 6 - hexString.length;
657 # var resultBuilder = [&#x27;#&#x27;];
658 # for (var i = 0; i &lt; missingZeros; i++) {
659 # resultBuilder.push(&#x27;0&#x27;);
660 # }
661 # resultBuilder.push(hexString);
662 # return resultBuilder.join(&#x27;&#x27;);
663 # };
664 #
665 # // ...
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700666 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700667 &quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
668 # the final pixel color is defined by the equation:
669 #
670 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
671 #
672 # This means that a value of 1.0 corresponds to a solid color, whereas
673 # a value of 0.0 corresponds to a completely transparent color. This
674 # uses a wrapper message rather than a simple float scalar so that it is
675 # possible to distinguish between a default value and the value being unset.
676 # If omitted, this color object is to be rendered as a solid color
677 # (as if the alpha value had been explicitly given with a value of 1.0).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700678 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
679 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700680 },
681 &quot;score&quot;: 3.14, # Image-specific score for this color. Value in range [0, 1].
682 },
683 ],
684 },
685 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700686 &quot;cropHintsAnnotation&quot;: { # Set of crop hints that are used to generate new crops when serving images. # If present, crop hints have completed successfully.
687 &quot;cropHints&quot;: [ # Crop hint results.
688 { # Single crop hint that is used to generate a new crop when serving an image.
689 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the crop region. The coordinates of the bounding
690 # box are in the original image&#x27;s scale.
691 &quot;vertices&quot;: [ # The bounding polygon vertices.
692 { # A vertex represents a 2D point in the image.
693 # NOTE: the vertex coordinates are in the same scale as the original image.
694 &quot;x&quot;: 42, # X coordinate.
695 &quot;y&quot;: 42, # Y coordinate.
696 },
697 ],
698 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
699 { # A vertex represents a 2D point in the image.
700 # NOTE: the normalized vertex coordinates are relative to the original image
701 # and range from 0 to 1.
702 &quot;x&quot;: 3.14, # X coordinate.
703 &quot;y&quot;: 3.14, # Y coordinate.
704 },
705 ],
706 },
707 &quot;importanceFraction&quot;: 3.14, # Fraction of importance of this salient region with respect to the original
708 # image.
709 &quot;confidence&quot;: 3.14, # Confidence of this being a salient region. Range [0, 1].
710 },
711 ],
712 },
713 &quot;fullTextAnnotation&quot;: { # TextAnnotation contains a structured representation of OCR extracted text. # If present, text (OCR) detection or document (OCR) text detection has
714 # completed successfully.
715 # This annotation provides the structural hierarchy for the OCR detected
716 # text.
717 # The hierarchy of an OCR extracted text structure is like this:
718 # TextAnnotation -&gt; Page -&gt; Block -&gt; Paragraph -&gt; Word -&gt; Symbol
719 # Each structural component, starting from Page, may further have their own
720 # properties. Properties describe detected languages, breaks etc.. Please refer
721 # to the TextAnnotation.TextProperty message definition below for more
722 # detail.
723 &quot;text&quot;: &quot;A String&quot;, # UTF-8 text detected on the pages.
724 &quot;pages&quot;: [ # List of pages detected by OCR.
725 { # Detected page from OCR.
726 &quot;blocks&quot;: [ # List of blocks of text, images etc on this page.
727 { # Logical element on the page.
728 &quot;blockType&quot;: &quot;A String&quot;, # Detected block type (text, image etc) for this block.
729 &quot;paragraphs&quot;: [ # List of paragraphs in this block (if this blocks is of type text).
730 { # Structural unit of text representing a number of words in certain order.
731 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the paragraph. Range [0, 1].
732 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the paragraph.
733 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
734 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
735 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
736 },
737 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
738 { # Detected language for a structural component.
739 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
740 &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
741 # information, see
742 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
743 },
744 ],
745 },
746 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the paragraph.
747 # The vertices are in the order of top-left, top-right, bottom-right,
748 # bottom-left. When a rotation of the bounding box is detected the rotation
749 # is represented as around the top-left corner as defined when the text is
750 # read in the &#x27;natural&#x27; orientation.
751 # For example:
752 # * when the text is horizontal it might look like:
753 # 0----1
754 # | |
755 # 3----2
756 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
757 # 2----3
758 # | |
759 # 1----0
760 # and the vertex order will still be (0, 1, 2, 3).
761 &quot;vertices&quot;: [ # The bounding polygon vertices.
762 { # A vertex represents a 2D point in the image.
763 # NOTE: the vertex coordinates are in the same scale as the original image.
764 &quot;x&quot;: 42, # X coordinate.
765 &quot;y&quot;: 42, # Y coordinate.
766 },
767 ],
768 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
769 { # A vertex represents a 2D point in the image.
770 # NOTE: the normalized vertex coordinates are relative to the original image
771 # and range from 0 to 1.
772 &quot;x&quot;: 3.14, # X coordinate.
773 &quot;y&quot;: 3.14, # Y coordinate.
774 },
775 ],
776 },
777 &quot;words&quot;: [ # List of all words in this paragraph.
778 { # A word representation.
779 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the word. Range [0, 1].
780 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the word.
781 # The vertices are in the order of top-left, top-right, bottom-right,
782 # bottom-left. When a rotation of the bounding box is detected the rotation
783 # is represented as around the top-left corner as defined when the text is
784 # read in the &#x27;natural&#x27; orientation.
785 # For example:
786 # * when the text is horizontal it might look like:
787 # 0----1
788 # | |
789 # 3----2
790 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
791 # 2----3
792 # | |
793 # 1----0
794 # and the vertex order will still be (0, 1, 2, 3).
795 &quot;vertices&quot;: [ # The bounding polygon vertices.
796 { # A vertex represents a 2D point in the image.
797 # NOTE: the vertex coordinates are in the same scale as the original image.
798 &quot;x&quot;: 42, # X coordinate.
799 &quot;y&quot;: 42, # Y coordinate.
800 },
801 ],
802 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
803 { # A vertex represents a 2D point in the image.
804 # NOTE: the normalized vertex coordinates are relative to the original image
805 # and range from 0 to 1.
806 &quot;x&quot;: 3.14, # X coordinate.
807 &quot;y&quot;: 3.14, # Y coordinate.
808 },
809 ],
810 },
811 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the word.
812 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
813 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
814 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
815 },
816 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
817 { # Detected language for a structural component.
818 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
819 &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
820 # information, see
821 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
822 },
823 ],
824 },
825 &quot;symbols&quot;: [ # List of symbols in the word.
826 # The order of the symbols follows the natural reading order.
827 { # A single symbol representation.
828 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the symbol. Range [0, 1].
829 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the symbol.
830 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
831 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
832 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
833 },
834 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
835 { # Detected language for a structural component.
836 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
837 &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
838 # information, see
839 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
840 },
841 ],
842 },
843 &quot;text&quot;: &quot;A String&quot;, # The actual UTF-8 representation of the symbol.
844 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the symbol.
845 # The vertices are in the order of top-left, top-right, bottom-right,
846 # bottom-left. When a rotation of the bounding box is detected the rotation
847 # is represented as around the top-left corner as defined when the text is
848 # read in the &#x27;natural&#x27; orientation.
849 # For example:
850 # * when the text is horizontal it might look like:
851 # 0----1
852 # | |
853 # 3----2
854 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
855 # 2----3
856 # | |
857 # 1----0
858 # and the vertex order will still be (0, 1, 2, 3).
859 &quot;vertices&quot;: [ # The bounding polygon vertices.
860 { # A vertex represents a 2D point in the image.
861 # NOTE: the vertex coordinates are in the same scale as the original image.
862 &quot;x&quot;: 42, # X coordinate.
863 &quot;y&quot;: 42, # Y coordinate.
864 },
865 ],
866 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
867 { # A vertex represents a 2D point in the image.
868 # NOTE: the normalized vertex coordinates are relative to the original image
869 # and range from 0 to 1.
870 &quot;x&quot;: 3.14, # X coordinate.
871 &quot;y&quot;: 3.14, # Y coordinate.
872 },
873 ],
874 },
875 },
876 ],
877 },
878 ],
879 },
880 ],
881 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the block.
882 # The vertices are in the order of top-left, top-right, bottom-right,
883 # bottom-left. When a rotation of the bounding box is detected the rotation
884 # is represented as around the top-left corner as defined when the text is
885 # read in the &#x27;natural&#x27; orientation.
886 # For example:
887 #
888 # * when the text is horizontal it might look like:
889 #
890 # 0----1
891 # | |
892 # 3----2
893 #
894 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
895 #
896 # 2----3
897 # | |
898 # 1----0
899 #
900 # and the vertex order will still be (0, 1, 2, 3).
901 &quot;vertices&quot;: [ # The bounding polygon vertices.
902 { # A vertex represents a 2D point in the image.
903 # NOTE: the vertex coordinates are in the same scale as the original image.
904 &quot;x&quot;: 42, # X coordinate.
905 &quot;y&quot;: 42, # Y coordinate.
906 },
907 ],
908 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
909 { # A vertex represents a 2D point in the image.
910 # NOTE: the normalized vertex coordinates are relative to the original image
911 # and range from 0 to 1.
912 &quot;x&quot;: 3.14, # X coordinate.
913 &quot;y&quot;: 3.14, # Y coordinate.
914 },
915 ],
916 },
917 &quot;confidence&quot;: 3.14, # Confidence of the OCR results on the block. Range [0, 1].
918 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the block.
919 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
920 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
921 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
922 },
923 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
924 { # Detected language for a structural component.
925 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
926 &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
927 # information, see
928 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
929 },
930 ],
931 },
932 },
933 ],
934 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected on the page.
935 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
936 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
937 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
938 },
939 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
940 { # Detected language for a structural component.
941 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
942 &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
943 # information, see
944 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
945 },
946 ],
947 },
948 &quot;width&quot;: 42, # Page width. For PDFs the unit is points. For images (including
949 # TIFFs) the unit is pixels.
950 &quot;confidence&quot;: 3.14, # Confidence of the OCR results on the page. Range [0, 1].
951 &quot;height&quot;: 42, # Page height. For PDFs the unit is points. For images (including
952 # TIFFs) the unit is pixels.
953 },
954 ],
955 },
956 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # If set, represents the error message for the operation.
957 # Note that filled-in image annotations are guaranteed to be
958 # correct, even when `error` is set.
959 # different programming environments, including REST APIs and RPC APIs. It is
960 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
961 # three pieces of data: error code, error message, and error details.
962 #
963 # You can find out more about this error model and how to work with it in the
964 # [API Design Guide](https://cloud.google.com/apis/design/errors).
965 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
966 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
967 # message types for APIs to use.
968 {
969 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
970 },
971 ],
972 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
973 # user-facing error message should be localized and sent in the
974 # google.rpc.Status.details field, or localized by the client.
975 },
976 &quot;localizedObjectAnnotations&quot;: [ # If present, localized object detection has completed successfully.
977 # This will be sorted descending by confidence score.
978 { # Set of detected objects with bounding boxes.
979 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this object belongs. This must be populated.
980 &quot;vertices&quot;: [ # The bounding polygon vertices.
981 { # A vertex represents a 2D point in the image.
982 # NOTE: the vertex coordinates are in the same scale as the original image.
983 &quot;x&quot;: 42, # X coordinate.
984 &quot;y&quot;: 42, # Y coordinate.
985 },
986 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700987 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
988 { # A vertex represents a 2D point in the image.
989 # NOTE: the normalized vertex coordinates are relative to the original image
990 # and range from 0 to 1.
991 &quot;x&quot;: 3.14, # X coordinate.
992 &quot;y&quot;: 3.14, # Y coordinate.
993 },
994 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700995 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700996 &quot;name&quot;: &quot;A String&quot;, # Object name, expressed in its `language_code` language.
997 &quot;mid&quot;: &quot;A String&quot;, # Object ID that should align with EntityAnnotation mid.
998 &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
999 # information, see
1000 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1001 &quot;score&quot;: 3.14, # Score of the result. Range [0, 1].
1002 },
1003 ],
1004 &quot;labelAnnotations&quot;: [ # If present, label detection has completed successfully.
1005 { # Set of detected entity features.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001006 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
1007 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
1008 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
1009 # detected distant towering building, even though the confidence that
1010 # there is a tower in each image may be the same. Range [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001011 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
1012 # `description` is expressed.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001013 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
1014 # `LocationInfo` elements can be present because one location may
1015 # indicate the location of the scene in the image, and another location
1016 # may indicate the location of the place where the image was taken.
1017 # Location information is usually present for landmarks.
1018 { # Detected entity location information.
1019 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
1020 # of doubles representing degrees latitude and degrees longitude. Unless
1021 # specified otherwise, this must conform to the
1022 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1023 # standard&lt;/a&gt;. Values must be within normalized ranges.
1024 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1025 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1026 },
1027 },
1028 ],
1029 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
1030 # [Google Knowledge Graph Search
1031 # API](https://developers.google.com/knowledge-graph/).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001032 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001033 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
1034 # The accuracy of the entity detection in an image.
1035 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
1036 # this field represents the confidence that there is a tower in the query
1037 # image. Range [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001038 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
1039 # for `LABEL_DETECTION` features.
1040 &quot;vertices&quot;: [ # The bounding polygon vertices.
1041 { # A vertex represents a 2D point in the image.
1042 # NOTE: the vertex coordinates are in the same scale as the original image.
1043 &quot;x&quot;: 42, # X coordinate.
1044 &quot;y&quot;: 42, # Y coordinate.
1045 },
1046 ],
1047 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1048 { # A vertex represents a 2D point in the image.
1049 # NOTE: the normalized vertex coordinates are relative to the original image
1050 # and range from 0 to 1.
1051 &quot;x&quot;: 3.14, # X coordinate.
1052 &quot;y&quot;: 3.14, # Y coordinate.
1053 },
1054 ],
1055 },
1056 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
1057 # fields, such a score or string that qualifies the entity.
1058 { # A `Property` consists of a user-supplied name/value pair.
1059 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
1060 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
1061 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
1062 },
1063 ],
1064 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
1065 },
1066 ],
1067 &quot;logoAnnotations&quot;: [ # If present, logo detection has completed successfully.
1068 { # Set of detected entity features.
1069 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
1070 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
1071 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
1072 # detected distant towering building, even though the confidence that
1073 # there is a tower in each image may be the same. Range [0, 1].
1074 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
1075 # `description` is expressed.
1076 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
1077 # `LocationInfo` elements can be present because one location may
1078 # indicate the location of the scene in the image, and another location
1079 # may indicate the location of the place where the image was taken.
1080 # Location information is usually present for landmarks.
1081 { # Detected entity location information.
1082 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
1083 # of doubles representing degrees latitude and degrees longitude. Unless
1084 # specified otherwise, this must conform to the
1085 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1086 # standard&lt;/a&gt;. Values must be within normalized ranges.
1087 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1088 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1089 },
1090 },
1091 ],
1092 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
1093 # [Google Knowledge Graph Search
1094 # API](https://developers.google.com/knowledge-graph/).
1095 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
1096 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
1097 # The accuracy of the entity detection in an image.
1098 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
1099 # this field represents the confidence that there is a tower in the query
1100 # image. Range [0, 1].
1101 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
1102 # for `LABEL_DETECTION` features.
1103 &quot;vertices&quot;: [ # The bounding polygon vertices.
1104 { # A vertex represents a 2D point in the image.
1105 # NOTE: the vertex coordinates are in the same scale as the original image.
1106 &quot;x&quot;: 42, # X coordinate.
1107 &quot;y&quot;: 42, # Y coordinate.
1108 },
1109 ],
1110 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1111 { # A vertex represents a 2D point in the image.
1112 # NOTE: the normalized vertex coordinates are relative to the original image
1113 # and range from 0 to 1.
1114 &quot;x&quot;: 3.14, # X coordinate.
1115 &quot;y&quot;: 3.14, # Y coordinate.
1116 },
1117 ],
1118 },
1119 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
1120 # fields, such a score or string that qualifies the entity.
1121 { # A `Property` consists of a user-supplied name/value pair.
1122 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
1123 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
1124 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
1125 },
1126 ],
1127 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001128 },
1129 ],
1130 &quot;context&quot;: { # If an image was produced from a file (e.g. a PDF), this message gives # If present, contextual information is needed to understand where this image
1131 # comes from.
1132 # information about the source of that image.
1133 &quot;uri&quot;: &quot;A String&quot;, # The URI of the file used to produce the image.
1134 &quot;pageNumber&quot;: 42, # If the file was a PDF or TIFF, this field gives the page number within
1135 # the file used to produce the image.
1136 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001137 &quot;faceAnnotations&quot;: [ # If present, face detection has completed successfully.
1138 { # A face annotation object contains the results of face detection.
1139 &quot;surpriseLikelihood&quot;: &quot;A String&quot;, # Surprise likelihood.
1140 &quot;headwearLikelihood&quot;: &quot;A String&quot;, # Headwear likelihood.
1141 &quot;angerLikelihood&quot;: &quot;A String&quot;, # Anger likelihood.
1142 &quot;detectionConfidence&quot;: 3.14, # Detection confidence. Range [0, 1].
1143 &quot;landmarkingConfidence&quot;: 3.14, # Face landmarking confidence. Range [0, 1].
1144 &quot;blurredLikelihood&quot;: &quot;A String&quot;, # Blurred likelihood.
1145 &quot;tiltAngle&quot;: 3.14, # Pitch angle, which indicates the upwards/downwards angle that the face is
1146 # pointing relative to the image&#x27;s horizontal plane. Range [-180,180].
1147 &quot;sorrowLikelihood&quot;: &quot;A String&quot;, # Sorrow likelihood.
1148 &quot;panAngle&quot;: 3.14, # Yaw angle, which indicates the leftward/rightward angle that the face is
1149 # pointing relative to the vertical plane perpendicular to the image. Range
1150 # [-180,180].
1151 &quot;landmarks&quot;: [ # Detected face landmarks.
1152 { # A face-specific landmark (for example, a face feature).
1153 &quot;position&quot;: { # A 3D position in the image, used primarily for Face detection landmarks. # Face landmark position.
1154 # A valid Position must have both x and y coordinates.
1155 # The position coordinates are in the same scale as the original image.
1156 &quot;z&quot;: 3.14, # Z coordinate (or depth).
1157 &quot;y&quot;: 3.14, # Y coordinate.
1158 &quot;x&quot;: 3.14, # X coordinate.
1159 },
1160 &quot;type&quot;: &quot;A String&quot;, # Face landmark type.
1161 },
1162 ],
1163 &quot;rollAngle&quot;: 3.14, # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
1164 # of the face relative to the image vertical about the axis perpendicular to
1165 # the face. Range [-180,180].
1166 &quot;underExposedLikelihood&quot;: &quot;A String&quot;, # Under-exposed likelihood.
1167 &quot;joyLikelihood&quot;: &quot;A String&quot;, # Joy likelihood.
1168 &quot;fdBoundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The `fd_bounding_poly` bounding polygon is tighter than the
1169 # `boundingPoly`, and encloses only the skin part of the face. Typically, it
1170 # is used to eliminate the face from any image analysis that detects the
1171 # &quot;amount of skin&quot; visible in an image. It is not based on the
1172 # landmarker results, only on the initial face detection, hence
1173 # the &lt;code&gt;fd&lt;/code&gt; (face detection) prefix.
1174 &quot;vertices&quot;: [ # The bounding polygon vertices.
1175 { # A vertex represents a 2D point in the image.
1176 # NOTE: the vertex coordinates are in the same scale as the original image.
1177 &quot;x&quot;: 42, # X coordinate.
1178 &quot;y&quot;: 42, # Y coordinate.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001179 },
1180 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001181 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1182 { # A vertex represents a 2D point in the image.
1183 # NOTE: the normalized vertex coordinates are relative to the original image
1184 # and range from 0 to 1.
1185 &quot;x&quot;: 3.14, # X coordinate.
1186 &quot;y&quot;: 3.14, # Y coordinate.
1187 },
1188 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001189 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001190 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the face. The coordinates of the bounding box
1191 # are in the original image&#x27;s scale.
1192 # The bounding box is computed to &quot;frame&quot; the face in accordance with human
1193 # expectations. It is based on the landmarker results.
1194 # Note that one or more x and/or y coordinates may not be generated in the
1195 # `BoundingPoly` (the polygon will be unbounded) if only a partial face
1196 # appears in the image to be annotated.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001197 &quot;vertices&quot;: [ # The bounding polygon vertices.
1198 { # A vertex represents a 2D point in the image.
1199 # NOTE: the vertex coordinates are in the same scale as the original image.
1200 &quot;x&quot;: 42, # X coordinate.
1201 &quot;y&quot;: 42, # Y coordinate.
1202 },
1203 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001204 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1205 { # A vertex represents a 2D point in the image.
1206 # NOTE: the normalized vertex coordinates are relative to the original image
1207 # and range from 0 to 1.
1208 &quot;x&quot;: 3.14, # X coordinate.
1209 &quot;y&quot;: 3.14, # Y coordinate.
1210 },
1211 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001212 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001213 },
1214 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001215 &quot;landmarkAnnotations&quot;: [ # If present, landmark detection has completed successfully.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001216 { # Set of detected entity features.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001217 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
1218 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
1219 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
1220 # detected distant towering building, even though the confidence that
1221 # there is a tower in each image may be the same. Range [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001222 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
1223 # `description` is expressed.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001224 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
1225 # `LocationInfo` elements can be present because one location may
1226 # indicate the location of the scene in the image, and another location
1227 # may indicate the location of the place where the image was taken.
1228 # Location information is usually present for landmarks.
1229 { # Detected entity location information.
1230 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
1231 # of doubles representing degrees latitude and degrees longitude. Unless
1232 # specified otherwise, this must conform to the
1233 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1234 # standard&lt;/a&gt;. Values must be within normalized ranges.
1235 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1236 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1237 },
1238 },
1239 ],
1240 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
1241 # [Google Knowledge Graph Search
1242 # API](https://developers.google.com/knowledge-graph/).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001243 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001244 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
1245 # The accuracy of the entity detection in an image.
1246 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
1247 # this field represents the confidence that there is a tower in the query
1248 # image. Range [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001249 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
1250 # for `LABEL_DETECTION` features.
1251 &quot;vertices&quot;: [ # The bounding polygon vertices.
1252 { # A vertex represents a 2D point in the image.
1253 # NOTE: the vertex coordinates are in the same scale as the original image.
1254 &quot;x&quot;: 42, # X coordinate.
1255 &quot;y&quot;: 42, # Y coordinate.
1256 },
1257 ],
1258 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1259 { # A vertex represents a 2D point in the image.
1260 # NOTE: the normalized vertex coordinates are relative to the original image
1261 # and range from 0 to 1.
1262 &quot;x&quot;: 3.14, # X coordinate.
1263 &quot;y&quot;: 3.14, # Y coordinate.
1264 },
1265 ],
1266 },
1267 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
1268 # fields, such a score or string that qualifies the entity.
1269 { # A `Property` consists of a user-supplied name/value pair.
1270 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
1271 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
1272 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
1273 },
1274 ],
1275 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001276 },
1277 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001278 },
1279 ],
1280 }</pre>
1281</div>
1282
1283<div class="method">
1284 <code class="details" id="asyncBatchAnnotate">asyncBatchAnnotate(parent, body=None, x__xgafv=None)</code>
1285 <pre>Run asynchronous image detection and annotation for a list of images.
1286
1287Progress and results can be retrieved through the
1288`google.longrunning.Operations` interface.
1289`Operation.metadata` contains `OperationMetadata` (metadata).
1290`Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
1291
1292This service will write image annotation outputs to json files in customer
1293GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
1294
1295Args:
1296 parent: string, Optional. Target project and location to make a call.
1297
1298Format: `projects/{project-id}/locations/{location-id}`.
1299
1300If no parent is specified, a region will be chosen automatically.
1301
1302Supported location-ids:
1303 `us`: USA country only,
1304 `asia`: East asia areas, like Japan, Taiwan,
1305 `eu`: The European Union.
1306
1307Example: `projects/project-A/locations/eu`. (required)
1308 body: object, The request body.
1309 The object takes the form of:
1310
1311{ # Request for async image annotation for a list of images.
1312 &quot;parent&quot;: &quot;A String&quot;, # Optional. Target project and location to make a call.
1313 #
1314 # Format: `projects/{project-id}/locations/{location-id}`.
1315 #
1316 # If no parent is specified, a region will be chosen automatically.
1317 #
1318 # Supported location-ids:
1319 # `us`: USA country only,
1320 # `asia`: East asia areas, like Japan, Taiwan,
1321 # `eu`: The European Union.
1322 #
1323 # Example: `projects/project-A/locations/eu`.
1324 &quot;outputConfig&quot;: { # The desired output location and metadata. # Required. The desired output location and metadata (e.g. format).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001325 &quot;batchSize&quot;: 42, # The max number of response protos to put into each output JSON file on
1326 # Google Cloud Storage.
1327 # The valid range is [1, 100]. If not specified, the default value is 20.
1328 #
1329 # For example, for one pdf file with 100 pages, 100 response protos will
1330 # be generated. If `batch_size` = 20, then 5 json files each
1331 # containing 20 response protos will be written under the prefix
1332 # `gcs_destination`.`uri`.
1333 #
1334 # Currently, batch_size only applies to GcsDestination, with potential future
1335 # support for other output configurations.
Bu Sun Kim65020912020-05-20 12:08:20 -07001336 &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.
1337 &quot;uri&quot;: &quot;A String&quot;, # Google Cloud Storage URI prefix where the results will be stored. Results
1338 # will be in JSON format and preceded by its corresponding input URI prefix.
1339 # This field can either represent a gcs file prefix or gcs directory. In
1340 # either case, the uri should be unique because in order to get all of the
1341 # output files, you will need to do a wildcard gcs search on the uri prefix
1342 # you provide.
1343 #
1344 # Examples:
1345 #
1346 # * File Prefix: gs://bucket-name/here/filenameprefix The output files
1347 # will be created in gs://bucket-name/here/ and the names of the
1348 # output files will begin with &quot;filenameprefix&quot;.
1349 #
1350 # * Directory Prefix: gs://bucket-name/some/location/ The output files
1351 # will be created in gs://bucket-name/some/location/ and the names of the
1352 # output files could be anything because there was no filename prefix
1353 # specified.
1354 #
1355 # If multiple outputs, each response is still AnnotateFileResponse, each of
1356 # which contains some subset of the full list of AnnotateImageResponse.
1357 # Multiple outputs can happen if, for example, the output JSON is too large
1358 # and overflows into multiple sharded files.
1359 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001360 },
1361 &quot;requests&quot;: [ # Required. Individual image annotation requests for this batch.
1362 { # Request for performing Google Cloud Vision API tasks over a user-provided
1363 # image, with user-requested features, and with context information.
1364 &quot;image&quot;: { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
1365 &quot;content&quot;: &quot;A String&quot;, # Image content, represented as a stream of bytes.
1366 # Note: As with all `bytes` fields, protobuffers use a pure binary
1367 # representation, whereas JSON representations use base64.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001368 #
1369 # Currently, this field only works for BatchAnnotateImages requests. It does
1370 # not work for AsyncBatchAnnotateImages requests.
Bu Sun Kim65020912020-05-20 12:08:20 -07001371 &quot;source&quot;: { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image
1372 # URL. If both `content` and `source` are provided for an image, `content`
1373 # takes precedence and is used to perform the image annotation request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001374 &quot;gcsImageUri&quot;: &quot;A String&quot;, # **Use `image_uri` instead.**
1375 #
1376 # The Google Cloud Storage URI of the form
1377 # `gs://bucket_name/object_name`. Object versioning is not supported. See
1378 # [Google Cloud Storage Request
1379 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
Bu Sun Kim65020912020-05-20 12:08:20 -07001380 &quot;imageUri&quot;: &quot;A String&quot;, # The URI of the source image. Can be either:
1381 #
1382 # 1. A Google Cloud Storage URI of the form
1383 # `gs://bucket_name/object_name`. Object versioning is not supported. See
1384 # [Google Cloud Storage Request
1385 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
1386 # info.
1387 #
1388 # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
1389 # HTTP/HTTPS URLs, Google cannot guarantee that the request will be
1390 # completed. Your request may fail if the specified host denies the
1391 # request (e.g. due to request throttling or DOS prevention), or if Google
1392 # throttles requests to the site for abuse prevention. You should not
1393 # depend on externally-hosted images for production applications.
1394 #
1395 # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
1396 # precedence.
Bu Sun Kim65020912020-05-20 12:08:20 -07001397 },
1398 },
1399 &quot;features&quot;: [ # Requested features.
1400 { # The type of Google Cloud Vision API detection to perform, and the maximum
1401 # number of results to return for that type. Multiple `Feature` objects can
1402 # be specified in the `features` list.
1403 &quot;type&quot;: &quot;A String&quot;, # The feature type.
1404 &quot;maxResults&quot;: 42, # Maximum number of results of this type. Does not apply to
1405 # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
1406 &quot;model&quot;: &quot;A String&quot;, # Model to use for the feature.
1407 # Supported values: &quot;builtin/stable&quot; (the default if unset) and
1408 # &quot;builtin/latest&quot;.
1409 },
1410 ],
1411 &quot;imageContext&quot;: { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
Bu Sun Kim65020912020-05-20 12:08:20 -07001412 &quot;cropHintsParams&quot;: { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
1413 &quot;aspectRatios&quot;: [ # Aspect ratios in floats, representing the ratio of the width to the height
1414 # of the image. For example, if the desired aspect ratio is 4/3, the
1415 # corresponding float value should be 1.33333. If not specified, the
1416 # best possible crop is returned. The number of provided aspect ratios is
1417 # limited to a maximum of 16; any aspect ratios provided after the 16th are
1418 # ignored.
1419 3.14,
1420 ],
1421 },
1422 &quot;productSearchParams&quot;: { # Parameters for a product search request. # Parameters for product search.
Bu Sun Kim65020912020-05-20 12:08:20 -07001423 &quot;productCategories&quot;: [ # The list of product categories to search in. Currently, we only consider
1424 # the first category, and either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;,
1425 # &quot;packagedgoods-v1&quot;, or &quot;general-v1&quot; should be specified. The legacy
1426 # categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported but will
1427 # be deprecated. For new products, please use &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;,
1428 # or &quot;toys-v2&quot; for better product search accuracy. It is recommended to
1429 # migrate existing products to these categories as well.
1430 &quot;A String&quot;,
1431 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001432 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image.
1433 # If it is not specified, system discretion will be applied.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001434 &quot;vertices&quot;: [ # The bounding polygon vertices.
1435 { # A vertex represents a 2D point in the image.
1436 # NOTE: the vertex coordinates are in the same scale as the original image.
1437 &quot;x&quot;: 42, # X coordinate.
1438 &quot;y&quot;: 42, # Y coordinate.
1439 },
1440 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001441 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1442 { # A vertex represents a 2D point in the image.
1443 # NOTE: the normalized vertex coordinates are relative to the original image
1444 # and range from 0 to 1.
1445 &quot;x&quot;: 3.14, # X coordinate.
1446 &quot;y&quot;: 3.14, # Y coordinate.
1447 },
1448 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001449 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001450 &quot;productSet&quot;: &quot;A String&quot;, # The resource name of a ProductSet to be searched for similar images.
1451 #
1452 # Format is:
1453 # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
1454 &quot;filter&quot;: &quot;A String&quot;, # The filtering expression. This can be used to restrict search results based
1455 # on Product labels. We currently support an AND of OR of key-value
1456 # expressions, where each expression within an OR must have the same key. An
1457 # &#x27;=&#x27; should be used to connect the key and value.
1458 #
1459 # For example, &quot;(color = red OR color = blue) AND brand = Google&quot; is
1460 # acceptable, but &quot;(color = red OR brand = Google)&quot; is not acceptable.
1461 # &quot;color: red&quot; is not acceptable because it uses a &#x27;:&#x27; instead of an &#x27;=&#x27;.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001462 },
1463 &quot;languageHints&quot;: [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
1464 # yields the best results since it enables automatic language detection. For
1465 # languages based on the Latin alphabet, setting `language_hints` is not
1466 # needed. In rare cases, when the language of the text in the image is known,
1467 # setting a hint will help get better results (although it will be a
1468 # significant hindrance if the hint is wrong). Text detection returns an
1469 # error if one or more of the specified languages is not one of the
1470 # [supported languages](https://cloud.google.com/vision/docs/languages).
1471 &quot;A String&quot;,
1472 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001473 &quot;latLongRect&quot;: { # Rectangle determined by min and max `LatLng` pairs. # Not used.
1474 &quot;maxLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Max lat/long pair.
1475 # of doubles representing degrees latitude and degrees longitude. Unless
1476 # specified otherwise, this must conform to the
1477 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1478 # standard&lt;/a&gt;. Values must be within normalized ranges.
1479 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1480 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1481 },
1482 &quot;minLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Min lat/long pair.
1483 # of doubles representing degrees latitude and degrees longitude. Unless
1484 # specified otherwise, this must conform to the
1485 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1486 # standard&lt;/a&gt;. Values must be within normalized ranges.
1487 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1488 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1489 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001490 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001491 &quot;webDetectionParams&quot;: { # Parameters for web detection request. # Parameters for web detection.
1492 &quot;includeGeoResults&quot;: True or False, # Whether to include results derived from the geo information in the image.
1493 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001494 },
1495 },
1496 ],
1497 }
1498
1499 x__xgafv: string, V1 error format.
1500 Allowed values
1501 1 - v1 error format
1502 2 - v2 error format
1503
1504Returns:
1505 An object of the form:
1506
1507 { # This resource represents a long-running operation that is the result of a
1508 # network API call.
Bu Sun Kim65020912020-05-20 12:08:20 -07001509 &quot;response&quot;: { # The normal response of the operation in case of success. If the original
1510 # method returns no data on success, such as `Delete`, the response is
1511 # `google.protobuf.Empty`. If the original method is standard
1512 # `Get`/`Create`/`Update`, the response should be the resource. For other
1513 # methods, the response should have the type `XxxResponse`, where `Xxx`
1514 # is the original method name. For example, if the original method name
1515 # is `TakeSnapshot()`, the inferred response type is
1516 # `TakeSnapshotResponse`.
1517 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1518 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001519 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
1520 # contains progress information and common metadata such as create time.
1521 # Some services might not provide such metadata. Any method that returns a
1522 # long-running operation should document the metadata type, if any.
1523 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1524 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001525 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
1526 # originally returns it. If you use the default HTTP mapping, the
1527 # `name` should be a resource name ending with `operations/{unique_id}`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001528 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
1529 # different programming environments, including REST APIs and RPC APIs. It is
1530 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1531 # three pieces of data: error code, error message, and error details.
1532 #
1533 # You can find out more about this error model and how to work with it in the
1534 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1535 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1536 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1537 # message types for APIs to use.
1538 {
1539 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1540 },
1541 ],
1542 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1543 # user-facing error message should be localized and sent in the
1544 # google.rpc.Status.details field, or localized by the client.
1545 },
1546 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
1547 # If `true`, the operation is completed, and either `error` or `response` is
1548 # available.
Bu Sun Kim65020912020-05-20 12:08:20 -07001549 }</pre>
1550</div>
1551
1552</body></html>