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