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