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