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