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