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