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