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