blob: 026e536f51624b811ac2c7bc7c5dc2ef2bc038a4 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="vision_v1p1beta1.html">Cloud Vision API</a> . <a href="vision_v1p1beta1.images.html">images</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#annotate">annotate(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Run image detection and annotation for a batch of images.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#asyncBatchAnnotate">asyncBatchAnnotate(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Run asynchronous image detection and annotation for a list of images.</p>
83<h3>Method Details</h3>
84<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070085 <code class="details" id="annotate">annotate(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070086 <pre>Run image detection and annotation for a batch of images.
87
88Args:
Dan O'Mearadd494642020-05-01 07:42:23 -070089 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 The object takes the form of:
91
92{ # Multiple image annotation requests are batched into a single service call.
Bu Sun Kim65020912020-05-20 12:08:20 -070093 &quot;requests&quot;: [ # Required. Individual image annotation requests for this batch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094 { # Request for performing Google Cloud Vision API tasks over a user-provided
95 # image, with user-requested features, and with context information.
Bu Sun Kim65020912020-05-20 12:08:20 -070096 &quot;image&quot;: { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
97 &quot;content&quot;: &quot;A String&quot;, # Image content, represented as a stream of bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098 # Note: As with all `bytes` fields, protobuffers use a pure binary
99 # representation, whereas JSON representations use base64.
Bu Sun Kim65020912020-05-20 12:08:20 -0700100 &quot;source&quot;: { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101 # URL. If both `content` and `source` are provided for an image, `content`
102 # takes precedence and is used to perform the image annotation request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700103 &quot;gcsImageUri&quot;: &quot;A String&quot;, # **Use `image_uri` instead.**
104 #
105 # The Google Cloud Storage URI of the form
106 # `gs://bucket_name/object_name`. Object versioning is not supported. See
107 # [Google Cloud Storage Request
108 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
Bu Sun Kim65020912020-05-20 12:08:20 -0700109 &quot;imageUri&quot;: &quot;A String&quot;, # The URI of the source image. Can be either:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110 #
111 # 1. A Google Cloud Storage URI of the form
112 # `gs://bucket_name/object_name`. Object versioning is not supported. See
113 # [Google Cloud Storage Request
114 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
115 # info.
116 #
117 # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
118 # HTTP/HTTPS URLs, Google cannot guarantee that the request will be
119 # completed. Your request may fail if the specified host denies the
120 # request (e.g. due to request throttling or DOS prevention), or if Google
121 # throttles requests to the site for abuse prevention. You should not
122 # depend on externally-hosted images for production applications.
123 #
124 # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
125 # precedence.
126 },
127 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700128 &quot;features&quot;: [ # Requested features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129 { # The type of Google Cloud Vision API detection to perform, and the maximum
130 # number of results to return for that type. Multiple `Feature` objects can
131 # be specified in the `features` list.
Bu Sun Kim65020912020-05-20 12:08:20 -0700132 &quot;type&quot;: &quot;A String&quot;, # The feature type.
133 &quot;maxResults&quot;: 42, # Maximum number of results of this type. Does not apply to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700134 # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700135 &quot;model&quot;: &quot;A String&quot;, # Model to use for the feature.
136 # Supported values: &quot;builtin/stable&quot; (the default if unset) and
137 # &quot;builtin/latest&quot;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700138 },
139 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 &quot;imageContext&quot;: { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
141 &quot;languageHints&quot;: [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
142 # yields the best results since it enables automatic language detection. For
143 # languages based on the Latin alphabet, setting `language_hints` is not
144 # needed. In rare cases, when the language of the text in the image is known,
145 # setting a hint will help get better results (although it will be a
146 # significant hindrance if the hint is wrong). Text detection returns an
147 # error if one or more of the specified languages is not one of the
148 # [supported languages](https://cloud.google.com/vision/docs/languages).
149 &quot;A String&quot;,
150 ],
151 &quot;webDetectionParams&quot;: { # Parameters for web detection request. # Parameters for web detection.
152 &quot;includeGeoResults&quot;: True or False, # Whether to include results derived from the geo information in the image.
153 },
154 &quot;latLongRect&quot;: { # Rectangle determined by min and max `LatLng` pairs. # Not used.
155 &quot;minLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Min lat/long pair.
156 # of doubles representing degrees latitude and degrees longitude. Unless
157 # specified otherwise, this must conform to the
158 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
159 # standard&lt;/a&gt;. Values must be within normalized ranges.
160 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
161 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
162 },
163 &quot;maxLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Max lat/long pair.
164 # of doubles representing degrees latitude and degrees longitude. Unless
165 # specified otherwise, this must conform to the
166 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
167 # standard&lt;/a&gt;. Values must be within normalized ranges.
168 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
169 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
170 },
171 },
172 &quot;cropHintsParams&quot;: { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
173 &quot;aspectRatios&quot;: [ # Aspect ratios in floats, representing the ratio of the width to the height
174 # of the image. For example, if the desired aspect ratio is 4/3, the
175 # corresponding float value should be 1.33333. If not specified, the
176 # best possible crop is returned. The number of provided aspect ratios is
177 # limited to a maximum of 16; any aspect ratios provided after the 16th are
178 # ignored.
179 3.14,
180 ],
181 },
182 &quot;productSearchParams&quot;: { # Parameters for a product search request. # Parameters for product search.
Bu Sun Kim65020912020-05-20 12:08:20 -0700183 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image.
184 # If it is not specified, system discretion will be applied.
185 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
186 { # A vertex represents a 2D point in the image.
187 # NOTE: the normalized vertex coordinates are relative to the original image
188 # and range from 0 to 1.
189 &quot;y&quot;: 3.14, # Y coordinate.
190 &quot;x&quot;: 3.14, # X coordinate.
191 },
192 ],
193 &quot;vertices&quot;: [ # The bounding polygon vertices.
194 { # A vertex represents a 2D point in the image.
195 # NOTE: the vertex coordinates are in the same scale as the original image.
196 &quot;y&quot;: 42, # Y coordinate.
197 &quot;x&quot;: 42, # X coordinate.
198 },
199 ],
200 },
201 &quot;productCategories&quot;: [ # The list of product categories to search in. Currently, we only consider
202 # the first category, and either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;,
203 # &quot;packagedgoods-v1&quot;, or &quot;general-v1&quot; should be specified. The legacy
204 # categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported but will
205 # be deprecated. For new products, please use &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;,
206 # or &quot;toys-v2&quot; for better product search accuracy. It is recommended to
207 # migrate existing products to these categories as well.
208 &quot;A String&quot;,
209 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700210 &quot;filter&quot;: &quot;A String&quot;, # The filtering expression. This can be used to restrict search results based
211 # on Product labels. We currently support an AND of OR of key-value
212 # expressions, where each expression within an OR must have the same key. An
213 # &#x27;=&#x27; should be used to connect the key and value.
214 #
215 # For example, &quot;(color = red OR color = blue) AND brand = Google&quot; is
216 # acceptable, but &quot;(color = red OR brand = Google)&quot; is not acceptable.
217 # &quot;color: red&quot; is not acceptable because it uses a &#x27;:&#x27; instead of an &#x27;=&#x27;.
218 &quot;productSet&quot;: &quot;A String&quot;, # The resource name of a ProductSet to be searched for similar images.
219 #
220 # Format is:
221 # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 },
223 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700224 },
225 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700226 &quot;parent&quot;: &quot;A String&quot;, # Optional. Target project and location to make a call.
227 #
228 # Format: `projects/{project-id}/locations/{location-id}`.
229 #
230 # If no parent is specified, a region will be chosen automatically.
231 #
232 # Supported location-ids:
233 # `us`: USA country only,
234 # `asia`: East asia areas, like Japan, Taiwan,
235 # `eu`: The European Union.
236 #
237 # Example: `projects/project-A/locations/eu`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700238 }
239
240 x__xgafv: string, V1 error format.
241 Allowed values
242 1 - v1 error format
243 2 - v2 error format
244
245Returns:
246 An object of the form:
247
248 { # Response to a batch image annotation request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700249 &quot;responses&quot;: [ # Individual responses to image annotation requests within the batch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700250 { # Response to an image annotation request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700251 &quot;localizedObjectAnnotations&quot;: [ # If present, localized object detection has completed successfully.
252 # This will be sorted descending by confidence score.
253 { # Set of detected objects with bounding boxes.
254 &quot;name&quot;: &quot;A String&quot;, # Object name, expressed in its `language_code` language.
255 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this object belongs. This must be populated.
Bu Sun Kim65020912020-05-20 12:08:20 -0700256 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700257 { # A vertex represents a 2D point in the image.
258 # NOTE: the normalized vertex coordinates are relative to the original image
259 # and range from 0 to 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700260 &quot;y&quot;: 3.14, # Y coordinate.
261 &quot;x&quot;: 3.14, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700262 },
263 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700264 &quot;vertices&quot;: [ # The bounding polygon vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700265 { # A vertex represents a 2D point in the image.
266 # NOTE: the vertex coordinates are in the same scale as the original image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700267 &quot;y&quot;: 42, # Y coordinate.
268 &quot;x&quot;: 42, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700269 },
270 ],
271 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700272 &quot;score&quot;: 3.14, # Score of the result. Range [0, 1].
273 &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
274 # information, see
275 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
276 &quot;mid&quot;: &quot;A String&quot;, # Object ID that should align with EntityAnnotation mid.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700277 },
278 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700279 &quot;productSearchResults&quot;: { # Results for a product search request. # If present, product search has completed successfully.
280 &quot;productGroupedResults&quot;: [ # List of results grouped by products detected in the query image. Each entry
281 # corresponds to one bounding polygon in the query image, and contains the
282 # matching products specific to that region. There may be duplicate product
283 # matches in the union of all the per-product results.
284 { # Information about the products similar to a single product in a query
285 # image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700286 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the product detected in the query image.
287 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
288 { # A vertex represents a 2D point in the image.
289 # NOTE: the normalized vertex coordinates are relative to the original image
290 # and range from 0 to 1.
291 &quot;y&quot;: 3.14, # Y coordinate.
292 &quot;x&quot;: 3.14, # X coordinate.
293 },
294 ],
295 &quot;vertices&quot;: [ # The bounding polygon vertices.
296 { # A vertex represents a 2D point in the image.
297 # NOTE: the vertex coordinates are in the same scale as the original image.
298 &quot;y&quot;: 42, # Y coordinate.
299 &quot;x&quot;: 42, # X coordinate.
300 },
301 ],
302 },
303 &quot;results&quot;: [ # List of results, one for each product match.
304 { # Information about a product.
305 &quot;image&quot;: &quot;A String&quot;, # The resource name of the image from the product that is the closest match
306 # to the query.
307 &quot;product&quot;: { # A Product contains ReferenceImages. # The Product.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700308 &quot;name&quot;: &quot;A String&quot;, # The resource name of the product.
309 #
310 # Format is:
311 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
312 #
313 # This field is ignored when creating a product.
Bu Sun Kim65020912020-05-20 12:08:20 -0700314 &quot;displayName&quot;: &quot;A String&quot;, # The user-provided name for this Product. Must not be empty. Must be at most
315 # 4096 characters long.
316 &quot;description&quot;: &quot;A String&quot;, # User-provided metadata to be stored with this product. Must be at most 4096
317 # characters long.
318 &quot;productCategory&quot;: &quot;A String&quot;, # Immutable. The category for the product identified by the reference image. This should
319 # be either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, or &quot;toys-v2&quot;. The legacy categories
320 # &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported, but these should
321 # not be used for new products.
322 &quot;productLabels&quot;: [ # Key-value pairs that can be attached to a product. At query time,
323 # constraints can be specified based on the product_labels.
324 #
325 # Note that integer values can be provided as strings, e.g. &quot;1199&quot;. Only
326 # strings with integer values can match a range-based restriction which is
327 # to be supported soon.
328 #
329 # Multiple values can be assigned to the same key. One product may have up to
330 # 500 product_labels.
331 #
332 # Notice that the total number of distinct product_labels over all products
333 # in one ProductSet cannot exceed 1M, otherwise the product search pipeline
334 # will refuse to work for that ProductSet.
335 { # A product label represented as a key-value pair.
336 &quot;key&quot;: &quot;A String&quot;, # The key of the label attached to the product. Cannot be empty and cannot
337 # exceed 128 bytes.
338 &quot;value&quot;: &quot;A String&quot;, # The value of the label attached to the product. Cannot be empty and
339 # cannot exceed 128 bytes.
340 },
341 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700342 },
343 &quot;score&quot;: 3.14, # A confidence level on the match, ranging from 0 (no confidence) to
344 # 1 (full confidence).
345 },
346 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700347 &quot;objectAnnotations&quot;: [ # List of generic predictions for the object in the bounding box.
348 { # Prediction for what the object in the bounding box is.
349 &quot;score&quot;: 3.14, # Score of the result. Range [0, 1].
350 &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
351 # information, see
352 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
353 &quot;mid&quot;: &quot;A String&quot;, # Object ID that should align with EntityAnnotation mid.
354 &quot;name&quot;: &quot;A String&quot;, # Object name, expressed in its `language_code` language.
355 },
356 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700357 },
358 ],
359 &quot;results&quot;: [ # List of results, one for each product match.
360 { # Information about a product.
361 &quot;image&quot;: &quot;A String&quot;, # The resource name of the image from the product that is the closest match
362 # to the query.
363 &quot;product&quot;: { # A Product contains ReferenceImages. # The Product.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700364 &quot;name&quot;: &quot;A String&quot;, # The resource name of the product.
365 #
366 # Format is:
367 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
368 #
369 # This field is ignored when creating a product.
Bu Sun Kim65020912020-05-20 12:08:20 -0700370 &quot;displayName&quot;: &quot;A String&quot;, # The user-provided name for this Product. Must not be empty. Must be at most
371 # 4096 characters long.
372 &quot;description&quot;: &quot;A String&quot;, # User-provided metadata to be stored with this product. Must be at most 4096
373 # characters long.
374 &quot;productCategory&quot;: &quot;A String&quot;, # Immutable. The category for the product identified by the reference image. This should
375 # be either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, or &quot;toys-v2&quot;. The legacy categories
376 # &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported, but these should
377 # not be used for new products.
378 &quot;productLabels&quot;: [ # Key-value pairs that can be attached to a product. At query time,
379 # constraints can be specified based on the product_labels.
380 #
381 # Note that integer values can be provided as strings, e.g. &quot;1199&quot;. Only
382 # strings with integer values can match a range-based restriction which is
383 # to be supported soon.
384 #
385 # Multiple values can be assigned to the same key. One product may have up to
386 # 500 product_labels.
387 #
388 # Notice that the total number of distinct product_labels over all products
389 # in one ProductSet cannot exceed 1M, otherwise the product search pipeline
390 # will refuse to work for that ProductSet.
391 { # A product label represented as a key-value pair.
392 &quot;key&quot;: &quot;A String&quot;, # The key of the label attached to the product. Cannot be empty and cannot
393 # exceed 128 bytes.
394 &quot;value&quot;: &quot;A String&quot;, # The value of the label attached to the product. Cannot be empty and
395 # cannot exceed 128 bytes.
396 },
397 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700398 },
399 &quot;score&quot;: 3.14, # A confidence level on the match, ranging from 0 (no confidence) to
400 # 1 (full confidence).
401 },
402 ],
403 &quot;indexTime&quot;: &quot;A String&quot;, # Timestamp of the index which provided these results. Products added to the
404 # product set and products removed from the product set after this time are
405 # not reflected in the current results.
406 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700407 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # If set, represents the error message for the operation.
408 # Note that filled-in image annotations are guaranteed to be
409 # correct, even when `error` is set.
410 # different programming environments, including REST APIs and RPC APIs. It is
411 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
412 # three pieces of data: error code, error message, and error details.
413 #
414 # You can find out more about this error model and how to work with it in the
415 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim65020912020-05-20 12:08:20 -0700416 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
417 # message types for APIs to use.
418 {
419 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
420 },
421 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700422 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
423 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
424 # user-facing error message should be localized and sent in the
425 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -0700426 },
427 &quot;fullTextAnnotation&quot;: { # TextAnnotation contains a structured representation of OCR extracted text. # If present, text (OCR) detection or document (OCR) text detection has
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700428 # completed successfully.
429 # This annotation provides the structural hierarchy for the OCR detected
430 # text.
431 # The hierarchy of an OCR extracted text structure is like this:
Dan O'Mearadd494642020-05-01 07:42:23 -0700432 # TextAnnotation -&gt; Page -&gt; Block -&gt; Paragraph -&gt; Word -&gt; Symbol
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700433 # Each structural component, starting from Page, may further have their own
434 # properties. Properties describe detected languages, breaks etc.. Please refer
435 # to the TextAnnotation.TextProperty message definition below for more
436 # detail.
Bu Sun Kim65020912020-05-20 12:08:20 -0700437 &quot;pages&quot;: [ # List of pages detected by OCR.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700438 { # Detected page from OCR.
Bu Sun Kim65020912020-05-20 12:08:20 -0700439 &quot;blocks&quot;: [ # List of blocks of text, images etc on this page.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700440 { # Logical element on the page.
Bu Sun Kim65020912020-05-20 12:08:20 -0700441 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the block.
442 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
443 { # Detected language for a structural component.
444 &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
445 # information, see
446 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
447 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
448 },
449 ],
450 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
451 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
452 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
453 },
454 },
455 &quot;blockType&quot;: &quot;A String&quot;, # Detected block type (text, image etc) for this block.
456 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the block.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700457 # The vertices are in the order of top-left, top-right, bottom-right,
458 # bottom-left. When a rotation of the bounding box is detected the rotation
459 # is represented as around the top-left corner as defined when the text is
Bu Sun Kim65020912020-05-20 12:08:20 -0700460 # read in the &#x27;natural&#x27; orientation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700461 # For example:
462 #
463 # * when the text is horizontal it might look like:
464 #
465 # 0----1
466 # | |
467 # 3----2
468 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700469 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700470 #
471 # 2----3
472 # | |
473 # 1----0
474 #
475 # and the vertex order will still be (0, 1, 2, 3).
Bu Sun Kim65020912020-05-20 12:08:20 -0700476 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700477 { # A vertex represents a 2D point in the image.
478 # NOTE: the normalized vertex coordinates are relative to the original image
479 # and range from 0 to 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700480 &quot;y&quot;: 3.14, # Y coordinate.
481 &quot;x&quot;: 3.14, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700482 },
483 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700484 &quot;vertices&quot;: [ # The bounding polygon vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700485 { # A vertex represents a 2D point in the image.
486 # NOTE: the vertex coordinates are in the same scale as the original image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700487 &quot;y&quot;: 42, # Y coordinate.
488 &quot;x&quot;: 42, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700489 },
490 ],
491 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700492 &quot;confidence&quot;: 3.14, # Confidence of the OCR results on the block. Range [0, 1].
493 &quot;paragraphs&quot;: [ # List of paragraphs in this block (if this blocks is of type text).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700494 { # Structural unit of text representing a number of words in certain order.
Bu Sun Kim65020912020-05-20 12:08:20 -0700495 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the paragraph.
496 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
497 { # Detected language for a structural component.
498 &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
499 # information, see
500 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
501 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
502 },
503 ],
504 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
505 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
506 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
507 },
508 },
509 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the paragraph.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700510 # The vertices are in the order of top-left, top-right, bottom-right,
511 # bottom-left. When a rotation of the bounding box is detected the rotation
512 # is represented as around the top-left corner as defined when the text is
Bu Sun Kim65020912020-05-20 12:08:20 -0700513 # read in the &#x27;natural&#x27; orientation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700514 # For example:
515 # * when the text is horizontal it might look like:
516 # 0----1
517 # | |
518 # 3----2
Bu Sun Kim65020912020-05-20 12:08:20 -0700519 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700520 # 2----3
521 # | |
522 # 1----0
523 # and the vertex order will still be (0, 1, 2, 3).
Bu Sun Kim65020912020-05-20 12:08:20 -0700524 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700525 { # A vertex represents a 2D point in the image.
526 # NOTE: the normalized vertex coordinates are relative to the original image
527 # and range from 0 to 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700528 &quot;y&quot;: 3.14, # Y coordinate.
529 &quot;x&quot;: 3.14, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700530 },
531 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700532 &quot;vertices&quot;: [ # The bounding polygon vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700533 { # A vertex represents a 2D point in the image.
534 # NOTE: the vertex coordinates are in the same scale as the original image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700535 &quot;y&quot;: 42, # Y coordinate.
536 &quot;x&quot;: 42, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700537 },
538 ],
539 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700540 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the paragraph. Range [0, 1].
541 &quot;words&quot;: [ # List of all words in this paragraph.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700542 { # A word representation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700543 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the word.
Dan O'Mearadd494642020-05-01 07:42:23 -0700544 # The vertices are in the order of top-left, top-right, bottom-right,
545 # bottom-left. When a rotation of the bounding box is detected the rotation
546 # is represented as around the top-left corner as defined when the text is
Bu Sun Kim65020912020-05-20 12:08:20 -0700547 # read in the &#x27;natural&#x27; orientation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700548 # For example:
549 # * when the text is horizontal it might look like:
550 # 0----1
551 # | |
552 # 3----2
Bu Sun Kim65020912020-05-20 12:08:20 -0700553 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
Dan O'Mearadd494642020-05-01 07:42:23 -0700554 # 2----3
555 # | |
556 # 1----0
557 # and the vertex order will still be (0, 1, 2, 3).
Bu Sun Kim65020912020-05-20 12:08:20 -0700558 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
Dan O'Mearadd494642020-05-01 07:42:23 -0700559 { # A vertex represents a 2D point in the image.
560 # NOTE: the normalized vertex coordinates are relative to the original image
561 # and range from 0 to 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700562 &quot;y&quot;: 3.14, # Y coordinate.
563 &quot;x&quot;: 3.14, # X coordinate.
Dan O'Mearadd494642020-05-01 07:42:23 -0700564 },
565 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700566 &quot;vertices&quot;: [ # The bounding polygon vertices.
Dan O'Mearadd494642020-05-01 07:42:23 -0700567 { # A vertex represents a 2D point in the image.
568 # NOTE: the vertex coordinates are in the same scale as the original image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700569 &quot;y&quot;: 42, # Y coordinate.
570 &quot;x&quot;: 42, # X coordinate.
Dan O'Mearadd494642020-05-01 07:42:23 -0700571 },
572 ],
573 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700574 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the word. Range [0, 1].
575 &quot;symbols&quot;: [ # List of symbols in the word.
576 # The order of the symbols follows the natural reading order.
577 { # A single symbol representation.
578 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the symbol.
579 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
580 { # Detected language for a structural component.
581 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
582 # information, see
583 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
584 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
585 },
586 ],
587 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
588 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
589 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
590 },
591 },
592 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # The bounding box for the symbol.
593 # The vertices are in the order of top-left, top-right, bottom-right,
594 # bottom-left. When a rotation of the bounding box is detected the rotation
595 # is represented as around the top-left corner as defined when the text is
596 # read in the &#x27;natural&#x27; orientation.
597 # For example:
598 # * when the text is horizontal it might look like:
599 # 0----1
600 # | |
601 # 3----2
602 # * when it&#x27;s rotated 180 degrees around the top-left corner it becomes:
603 # 2----3
604 # | |
605 # 1----0
606 # and the vertex order will still be (0, 1, 2, 3).
607 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
608 { # A vertex represents a 2D point in the image.
609 # NOTE: the normalized vertex coordinates are relative to the original image
610 # and range from 0 to 1.
611 &quot;y&quot;: 3.14, # Y coordinate.
612 &quot;x&quot;: 3.14, # X coordinate.
613 },
614 ],
615 &quot;vertices&quot;: [ # The bounding polygon vertices.
616 { # A vertex represents a 2D point in the image.
617 # NOTE: the vertex coordinates are in the same scale as the original image.
618 &quot;y&quot;: 42, # Y coordinate.
619 &quot;x&quot;: 42, # X coordinate.
620 },
621 ],
622 },
623 &quot;confidence&quot;: 3.14, # Confidence of the OCR results for the symbol. Range [0, 1].
624 &quot;text&quot;: &quot;A String&quot;, # The actual UTF-8 representation of the symbol.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700625 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700626 ],
627 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected for the word.
628 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700629 { # Detected language for a structural component.
Bu Sun Kim65020912020-05-20 12:08:20 -0700630 &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
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700631 # information, see
632 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
Bu Sun Kim65020912020-05-20 12:08:20 -0700633 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700634 },
635 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700636 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
637 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
638 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
639 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700640 },
641 },
642 ],
643 },
644 ],
645 },
646 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700647 &quot;property&quot;: { # Additional information detected on the structural component. # Additional information detected on the page.
648 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
649 { # Detected language for a structural component.
650 &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
651 # information, see
652 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
653 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
654 },
655 ],
656 &quot;detectedBreak&quot;: { # Detected start or end of a structural component. # Detected start or end of a text segment.
657 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
658 &quot;isPrefix&quot;: True or False, # True if break prepends the element.
659 },
660 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700661 &quot;confidence&quot;: 3.14, # Confidence of the OCR results on the page. Range [0, 1].
662 &quot;height&quot;: 42, # Page height. For PDFs the unit is points. For images (including
663 # TIFFs) the unit is pixels.
664 &quot;width&quot;: 42, # Page width. For PDFs the unit is points. For images (including
665 # TIFFs) the unit is pixels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700666 },
667 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700668 &quot;text&quot;: &quot;A String&quot;, # UTF-8 text detected on the pages.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700669 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700670 &quot;textAnnotations&quot;: [ # If present, text (OCR) detection has completed successfully.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700671 { # Set of detected entity features.
Bu Sun Kim65020912020-05-20 12:08:20 -0700672 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
673 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700674 # `LocationInfo` elements can be present because one location may
675 # indicate the location of the scene in the image, and another location
676 # may indicate the location of the place where the image was taken.
677 # Location information is usually present for landmarks.
678 { # Detected entity location information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700679 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700680 # of doubles representing degrees latitude and degrees longitude. Unless
681 # specified otherwise, this must conform to the
Bu Sun Kim65020912020-05-20 12:08:20 -0700682 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
Dan O'Mearadd494642020-05-01 07:42:23 -0700683 # standard&lt;/a&gt;. Values must be within normalized ranges.
Bu Sun Kim65020912020-05-20 12:08:20 -0700684 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
685 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700686 },
687 },
688 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700689 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
690 # [Google Knowledge Graph Search
691 # API](https://developers.google.com/knowledge-graph/).
692 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
693 # The accuracy of the entity detection in an image.
694 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
695 # this field represents the confidence that there is a tower in the query
696 # image. Range [0, 1].
697 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700698 # for `LABEL_DETECTION` features.
Bu Sun Kim65020912020-05-20 12:08:20 -0700699 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700700 { # A vertex represents a 2D point in the image.
701 # NOTE: the normalized vertex coordinates are relative to the original image
702 # and range from 0 to 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700703 &quot;y&quot;: 3.14, # Y coordinate.
704 &quot;x&quot;: 3.14, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700705 },
706 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700707 &quot;vertices&quot;: [ # The bounding polygon vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700708 { # A vertex represents a 2D point in the image.
709 # NOTE: the vertex coordinates are in the same scale as the original image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700710 &quot;y&quot;: 42, # Y coordinate.
711 &quot;x&quot;: 42, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700712 },
713 ],
714 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700715 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
716 # `description` is expressed.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700717 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
718 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
719 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
720 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
721 # detected distant towering building, even though the confidence that
722 # there is a tower in each image may be the same. Range [0, 1].
723 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
724 # fields, such a score or string that qualifies the entity.
725 { # A `Property` consists of a user-supplied name/value pair.
726 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
727 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
728 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
729 },
730 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700731 },
732 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700733 &quot;imagePropertiesAnnotation&quot;: { # Stores image properties, such as dominant colors. # If present, image properties were extracted successfully.
734 &quot;dominantColors&quot;: { # Set of dominant colors and their corresponding scores. # If present, dominant colors completed successfully.
735 &quot;colors&quot;: [ # RGB color values with their score and pixel fraction.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700736 { # Color information consists of RGB channels, score, and the fraction of
737 # the image that the color occupies in the image.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700738 &quot;score&quot;: 3.14, # Image-specific score for this color. Value in range [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700739 &quot;pixelFraction&quot;: 3.14, # The fraction of pixels the color occupies in the image.
740 # Value in range [0, 1].
741 &quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed # RGB components of the color.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700742 # for simplicity of conversion to/from color representations in various
743 # languages over compactness; for example, the fields of this representation
Bu Sun Kim65020912020-05-20 12:08:20 -0700744 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
745 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700746 # method in iOS; and, with just a little work, it can be easily formatted into
Bu Sun Kim65020912020-05-20 12:08:20 -0700747 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700748 #
749 # Note: this proto does not carry information about the absolute color space
750 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
751 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
752 # space.
753 #
754 # Example (Java):
755 #
756 # import com.google.type.Color;
757 #
758 # // ...
759 # public static java.awt.Color fromProto(Color protocolor) {
760 # float alpha = protocolor.hasAlpha()
761 # ? protocolor.getAlpha().getValue()
762 # : 1.0;
763 #
764 # return new java.awt.Color(
765 # protocolor.getRed(),
766 # protocolor.getGreen(),
767 # protocolor.getBlue(),
768 # alpha);
769 # }
770 #
771 # public static Color toProto(java.awt.Color color) {
772 # float red = (float) color.getRed();
773 # float green = (float) color.getGreen();
774 # float blue = (float) color.getBlue();
775 # float denominator = 255.0;
776 # Color.Builder resultBuilder =
777 # Color
778 # .newBuilder()
779 # .setRed(red / denominator)
780 # .setGreen(green / denominator)
781 # .setBlue(blue / denominator);
782 # int alpha = color.getAlpha();
783 # if (alpha != 255) {
784 # result.setAlpha(
785 # FloatValue
786 # .newBuilder()
787 # .setValue(((float) alpha) / denominator)
788 # .build());
789 # }
790 # return resultBuilder.build();
791 # }
792 # // ...
793 #
794 # Example (iOS / Obj-C):
795 #
796 # // ...
797 # static UIColor* fromProto(Color* protocolor) {
798 # float red = [protocolor red];
799 # float green = [protocolor green];
800 # float blue = [protocolor blue];
801 # FloatValue* alpha_wrapper = [protocolor alpha];
802 # float alpha = 1.0;
803 # if (alpha_wrapper != nil) {
804 # alpha = [alpha_wrapper value];
805 # }
806 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
807 # }
808 #
809 # static Color* toProto(UIColor* color) {
810 # CGFloat red, green, blue, alpha;
Dan O'Mearadd494642020-05-01 07:42:23 -0700811 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700812 # return nil;
813 # }
814 # Color* result = [[Color alloc] init];
815 # [result setRed:red];
816 # [result setGreen:green];
817 # [result setBlue:blue];
Dan O'Mearadd494642020-05-01 07:42:23 -0700818 # if (alpha &lt;= 0.9999) {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700819 # [result setAlpha:floatWrapperWithValue(alpha)];
820 # }
821 # [result autorelease];
822 # return result;
823 # }
824 # // ...
825 #
826 # Example (JavaScript):
827 #
828 # // ...
829 #
830 # var protoToCssColor = function(rgb_color) {
831 # var redFrac = rgb_color.red || 0.0;
832 # var greenFrac = rgb_color.green || 0.0;
833 # var blueFrac = rgb_color.blue || 0.0;
834 # var red = Math.floor(redFrac * 255);
835 # var green = Math.floor(greenFrac * 255);
836 # var blue = Math.floor(blueFrac * 255);
837 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700838 # if (!(&#x27;alpha&#x27; in rgb_color)) {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700839 # return rgbToCssColor_(red, green, blue);
840 # }
841 #
842 # var alphaFrac = rgb_color.alpha.value || 0.0;
Bu Sun Kim65020912020-05-20 12:08:20 -0700843 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
844 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700845 # };
846 #
847 # var rgbToCssColor_ = function(red, green, blue) {
Dan O'Mearadd494642020-05-01 07:42:23 -0700848 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700849 # var hexString = rgbNumber.toString(16);
850 # var missingZeros = 6 - hexString.length;
Bu Sun Kim65020912020-05-20 12:08:20 -0700851 # var resultBuilder = [&#x27;#&#x27;];
Dan O'Mearadd494642020-05-01 07:42:23 -0700852 # for (var i = 0; i &lt; missingZeros; i++) {
Bu Sun Kim65020912020-05-20 12:08:20 -0700853 # resultBuilder.push(&#x27;0&#x27;);
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700854 # }
855 # resultBuilder.push(hexString);
Bu Sun Kim65020912020-05-20 12:08:20 -0700856 # return resultBuilder.join(&#x27;&#x27;);
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700857 # };
858 #
859 # // ...
Bu Sun Kim65020912020-05-20 12:08:20 -0700860 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
861 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
862 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
863 &quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700864 # the final pixel color is defined by the equation:
865 #
866 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
867 #
868 # This means that a value of 1.0 corresponds to a solid color, whereas
869 # a value of 0.0 corresponds to a completely transparent color. This
870 # uses a wrapper message rather than a simple float scalar so that it is
871 # possible to distinguish between a default value and the value being unset.
872 # If omitted, this color object is to be rendered as a solid color
873 # (as if the alpha value had been explicitly given with a value of 1.0).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700874 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700875 },
876 ],
877 },
878 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700879 &quot;logoAnnotations&quot;: [ # If present, logo detection has completed successfully.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700880 { # Set of detected entity features.
Bu Sun Kim65020912020-05-20 12:08:20 -0700881 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
882 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700883 # `LocationInfo` elements can be present because one location may
884 # indicate the location of the scene in the image, and another location
885 # may indicate the location of the place where the image was taken.
886 # Location information is usually present for landmarks.
887 { # Detected entity location information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700888 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700889 # of doubles representing degrees latitude and degrees longitude. Unless
890 # specified otherwise, this must conform to the
Bu Sun Kim65020912020-05-20 12:08:20 -0700891 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
Dan O'Mearadd494642020-05-01 07:42:23 -0700892 # standard&lt;/a&gt;. Values must be within normalized ranges.
Bu Sun Kim65020912020-05-20 12:08:20 -0700893 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
894 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700895 },
896 },
897 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700898 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700899 # [Google Knowledge Graph Search
900 # API](https://developers.google.com/knowledge-graph/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700901 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
902 # The accuracy of the entity detection in an image.
903 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
904 # this field represents the confidence that there is a tower in the query
905 # image. Range [0, 1].
906 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700907 # for `LABEL_DETECTION` features.
Bu Sun Kim65020912020-05-20 12:08:20 -0700908 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700909 { # A vertex represents a 2D point in the image.
910 # NOTE: the normalized vertex coordinates are relative to the original image
911 # and range from 0 to 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700912 &quot;y&quot;: 3.14, # Y coordinate.
913 &quot;x&quot;: 3.14, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700914 },
915 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700916 &quot;vertices&quot;: [ # The bounding polygon vertices.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700917 { # A vertex represents a 2D point in the image.
918 # NOTE: the vertex coordinates are in the same scale as the original image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700919 &quot;y&quot;: 42, # Y coordinate.
920 &quot;x&quot;: 42, # X coordinate.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700921 },
922 ],
923 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700924 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
925 # `description` is expressed.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700926 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
927 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
928 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
929 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
930 # detected distant towering building, even though the confidence that
931 # there is a tower in each image may be the same. Range [0, 1].
932 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
933 # fields, such a score or string that qualifies the entity.
934 { # A `Property` consists of a user-supplied name/value pair.
935 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
936 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
937 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
938 },
939 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700940 },
941 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700942 &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
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700943 # comes from.
944 # information about the source of that image.
Bu Sun Kim65020912020-05-20 12:08:20 -0700945 &quot;uri&quot;: &quot;A String&quot;, # The URI of the file used to produce the image.
946 &quot;pageNumber&quot;: 42, # If the file was a PDF or TIFF, this field gives the page number within
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700947 # the file used to produce the image.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700948 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700949 &quot;webDetection&quot;: { # Relevant information for the image from the Internet. # If present, web detection has completed successfully.
950 &quot;visuallySimilarImages&quot;: [ # The visually similar image results.
951 { # Metadata for online images.
952 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
953 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
954 },
955 ],
956 &quot;bestGuessLabels&quot;: [ # The service&#x27;s best guess as to the topic of the request image.
957 # Inferred from similar images on the open web.
958 { # Label to provide extra metadata for the web detection.
959 &quot;label&quot;: &quot;A String&quot;, # Label for extra metadata.
960 &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;.
961 # For more information, see
962 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
963 },
964 ],
965 &quot;fullMatchingImages&quot;: [ # Fully matching images from the Internet.
966 # Can include resized copies of the query image.
967 { # Metadata for online images.
968 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
969 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
970 },
971 ],
972 &quot;webEntities&quot;: [ # Deduced entities from similar images on the Internet.
973 { # Entity deduced from similar images on the Internet.
974 &quot;entityId&quot;: &quot;A String&quot;, # Opaque entity ID.
975 &quot;description&quot;: &quot;A String&quot;, # Canonical description of the entity, in English.
976 &quot;score&quot;: 3.14, # Overall relevancy score for the entity.
977 # Not normalized and not comparable across different image queries.
978 },
979 ],
980 &quot;pagesWithMatchingImages&quot;: [ # Web pages containing the matching images from the Internet.
981 { # Metadata for web pages.
Bu Sun Kim65020912020-05-20 12:08:20 -0700982 &quot;partialMatchingImages&quot;: [ # Partial matching images on the page.
983 # Those images are similar enough to share some key-point features. For
984 # example an original image will likely have partial matching for its
985 # crops.
986 { # Metadata for online images.
987 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
988 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
989 },
990 ],
991 &quot;url&quot;: &quot;A String&quot;, # The result web page URL.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700992 &quot;pageTitle&quot;: &quot;A String&quot;, # Title for the web page, may contain HTML markups.
993 &quot;fullMatchingImages&quot;: [ # Fully matching images on the page.
994 # Can include resized copies of the query image.
995 { # Metadata for online images.
996 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
997 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
998 },
999 ],
1000 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the web page.
Bu Sun Kim65020912020-05-20 12:08:20 -07001001 },
1002 ],
1003 &quot;partialMatchingImages&quot;: [ # Partial matching images from the Internet.
1004 # Those images are similar enough to share some key-point features. For
1005 # example an original image will likely have partial matching for its crops.
1006 { # Metadata for online images.
1007 &quot;score&quot;: 3.14, # (Deprecated) Overall relevancy score for the image.
1008 &quot;url&quot;: &quot;A String&quot;, # The result image URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001009 },
1010 ],
1011 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001012 &quot;safeSearchAnnotation&quot;: { # Set of features pertaining to the image, computed by computer vision # If present, safe-search annotation has completed successfully.
1013 # methods over safe-search verticals (for example, adult, spoof, medical,
1014 # violence).
Bu Sun Kim65020912020-05-20 12:08:20 -07001015 &quot;violence&quot;: &quot;A String&quot;, # Likelihood that this image contains violent content.
1016 &quot;adult&quot;: &quot;A String&quot;, # Represents the adult content likelihood for the image. Adult content may
1017 # contain elements such as nudity, pornographic images or cartoons, or
1018 # sexual activities.
1019 &quot;spoof&quot;: &quot;A String&quot;, # Spoof likelihood. The likelihood that an modification
1020 # was made to the image&#x27;s canonical version to make it appear
1021 # funny or offensive.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001022 &quot;medical&quot;: &quot;A String&quot;, # Likelihood that this is a medical image.
1023 &quot;racy&quot;: &quot;A String&quot;, # Likelihood that the request image contains racy content. Racy content may
1024 # include (but is not limited to) skimpy or sheer clothing, strategically
1025 # covered nudity, lewd or provocative poses, or close-ups of sensitive
1026 # body areas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001027 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001028 &quot;landmarkAnnotations&quot;: [ # If present, landmark detection has completed successfully.
1029 { # Set of detected entity features.
1030 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
1031 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
1032 # `LocationInfo` elements can be present because one location may
1033 # indicate the location of the scene in the image, and another location
1034 # may indicate the location of the place where the image was taken.
1035 # Location information is usually present for landmarks.
1036 { # Detected entity location information.
1037 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
1038 # of doubles representing degrees latitude and degrees longitude. Unless
1039 # specified otherwise, this must conform to the
1040 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1041 # standard&lt;/a&gt;. Values must be within normalized ranges.
1042 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1043 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1044 },
1045 },
1046 ],
1047 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
1048 # [Google Knowledge Graph Search
1049 # API](https://developers.google.com/knowledge-graph/).
1050 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
1051 # The accuracy of the entity detection in an image.
1052 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
1053 # this field represents the confidence that there is a tower in the query
1054 # image. Range [0, 1].
1055 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
1056 # for `LABEL_DETECTION` features.
1057 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1058 { # A vertex represents a 2D point in the image.
1059 # NOTE: the normalized vertex coordinates are relative to the original image
1060 # and range from 0 to 1.
1061 &quot;y&quot;: 3.14, # Y coordinate.
1062 &quot;x&quot;: 3.14, # X coordinate.
1063 },
1064 ],
1065 &quot;vertices&quot;: [ # The bounding polygon vertices.
1066 { # A vertex represents a 2D point in the image.
1067 # NOTE: the vertex coordinates are in the same scale as the original image.
1068 &quot;y&quot;: 42, # Y coordinate.
1069 &quot;x&quot;: 42, # X coordinate.
1070 },
1071 ],
1072 },
1073 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
1074 # `description` is expressed.
1075 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
1076 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
1077 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
1078 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
1079 # detected distant towering building, even though the confidence that
1080 # there is a tower in each image may be the same. Range [0, 1].
1081 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
1082 # fields, such a score or string that qualifies the entity.
1083 { # A `Property` consists of a user-supplied name/value pair.
1084 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
1085 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
1086 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
1087 },
1088 ],
1089 },
1090 ],
1091 &quot;faceAnnotations&quot;: [ # If present, face detection has completed successfully.
1092 { # A face annotation object contains the results of face detection.
1093 &quot;surpriseLikelihood&quot;: &quot;A String&quot;, # Surprise likelihood.
1094 &quot;landmarks&quot;: [ # Detected face landmarks.
1095 { # A face-specific landmark (for example, a face feature).
1096 &quot;position&quot;: { # A 3D position in the image, used primarily for Face detection landmarks. # Face landmark position.
1097 # A valid Position must have both x and y coordinates.
1098 # The position coordinates are in the same scale as the original image.
1099 &quot;x&quot;: 3.14, # X coordinate.
1100 &quot;z&quot;: 3.14, # Z coordinate (or depth).
1101 &quot;y&quot;: 3.14, # Y coordinate.
1102 },
1103 &quot;type&quot;: &quot;A String&quot;, # Face landmark type.
1104 },
1105 ],
1106 &quot;angerLikelihood&quot;: &quot;A String&quot;, # Anger likelihood.
1107 &quot;landmarkingConfidence&quot;: 3.14, # Face landmarking confidence. Range [0, 1].
1108 &quot;joyLikelihood&quot;: &quot;A String&quot;, # Joy likelihood.
1109 &quot;detectionConfidence&quot;: 3.14, # Detection confidence. Range [0, 1].
1110 &quot;panAngle&quot;: 3.14, # Yaw angle, which indicates the leftward/rightward angle that the face is
1111 # pointing relative to the vertical plane perpendicular to the image. Range
1112 # [-180,180].
1113 &quot;underExposedLikelihood&quot;: &quot;A String&quot;, # Under-exposed likelihood.
1114 &quot;blurredLikelihood&quot;: &quot;A String&quot;, # Blurred likelihood.
1115 &quot;headwearLikelihood&quot;: &quot;A String&quot;, # Headwear likelihood.
1116 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the face. The coordinates of the bounding box
1117 # are in the original image&#x27;s scale.
1118 # The bounding box is computed to &quot;frame&quot; the face in accordance with human
1119 # expectations. It is based on the landmarker results.
1120 # Note that one or more x and/or y coordinates may not be generated in the
1121 # `BoundingPoly` (the polygon will be unbounded) if only a partial face
1122 # appears in the image to be annotated.
1123 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1124 { # A vertex represents a 2D point in the image.
1125 # NOTE: the normalized vertex coordinates are relative to the original image
1126 # and range from 0 to 1.
1127 &quot;y&quot;: 3.14, # Y coordinate.
1128 &quot;x&quot;: 3.14, # X coordinate.
1129 },
1130 ],
1131 &quot;vertices&quot;: [ # The bounding polygon vertices.
1132 { # A vertex represents a 2D point in the image.
1133 # NOTE: the vertex coordinates are in the same scale as the original image.
1134 &quot;y&quot;: 42, # Y coordinate.
1135 &quot;x&quot;: 42, # X coordinate.
1136 },
1137 ],
1138 },
1139 &quot;rollAngle&quot;: 3.14, # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
1140 # of the face relative to the image vertical about the axis perpendicular to
1141 # the face. Range [-180,180].
1142 &quot;sorrowLikelihood&quot;: &quot;A String&quot;, # Sorrow likelihood.
1143 &quot;tiltAngle&quot;: 3.14, # Pitch angle, which indicates the upwards/downwards angle that the face is
1144 # pointing relative to the image&#x27;s horizontal plane. Range [-180,180].
1145 &quot;fdBoundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The `fd_bounding_poly` bounding polygon is tighter than the
1146 # `boundingPoly`, and encloses only the skin part of the face. Typically, it
1147 # is used to eliminate the face from any image analysis that detects the
1148 # &quot;amount of skin&quot; visible in an image. It is not based on the
1149 # landmarker results, only on the initial face detection, hence
1150 # the &lt;code&gt;fd&lt;/code&gt; (face detection) prefix.
1151 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1152 { # A vertex represents a 2D point in the image.
1153 # NOTE: the normalized vertex coordinates are relative to the original image
1154 # and range from 0 to 1.
1155 &quot;y&quot;: 3.14, # Y coordinate.
1156 &quot;x&quot;: 3.14, # X coordinate.
1157 },
1158 ],
1159 &quot;vertices&quot;: [ # The bounding polygon vertices.
1160 { # A vertex represents a 2D point in the image.
1161 # NOTE: the vertex coordinates are in the same scale as the original image.
1162 &quot;y&quot;: 42, # Y coordinate.
1163 &quot;x&quot;: 42, # X coordinate.
1164 },
1165 ],
1166 },
1167 },
1168 ],
1169 &quot;cropHintsAnnotation&quot;: { # Set of crop hints that are used to generate new crops when serving images. # If present, crop hints have completed successfully.
1170 &quot;cropHints&quot;: [ # Crop hint results.
1171 { # Single crop hint that is used to generate a new crop when serving an image.
1172 &quot;confidence&quot;: 3.14, # Confidence of this being a salient region. Range [0, 1].
1173 &quot;importanceFraction&quot;: 3.14, # Fraction of importance of this salient region with respect to the original
1174 # image.
1175 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the crop region. The coordinates of the bounding
1176 # box are in the original image&#x27;s scale.
1177 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1178 { # A vertex represents a 2D point in the image.
1179 # NOTE: the normalized vertex coordinates are relative to the original image
1180 # and range from 0 to 1.
1181 &quot;y&quot;: 3.14, # Y coordinate.
1182 &quot;x&quot;: 3.14, # X coordinate.
1183 },
1184 ],
1185 &quot;vertices&quot;: [ # The bounding polygon vertices.
1186 { # A vertex represents a 2D point in the image.
1187 # NOTE: the vertex coordinates are in the same scale as the original image.
1188 &quot;y&quot;: 42, # Y coordinate.
1189 &quot;x&quot;: 42, # X coordinate.
1190 },
1191 ],
1192 },
1193 },
1194 ],
1195 },
1196 &quot;labelAnnotations&quot;: [ # If present, label detection has completed successfully.
1197 { # Set of detected entity features.
1198 &quot;score&quot;: 3.14, # Overall score of the result. Range [0, 1].
1199 &quot;locations&quot;: [ # The location information for the detected entity. Multiple
1200 # `LocationInfo` elements can be present because one location may
1201 # indicate the location of the scene in the image, and another location
1202 # may indicate the location of the place where the image was taken.
1203 # Location information is usually present for landmarks.
1204 { # Detected entity location information.
1205 &quot;latLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
1206 # of doubles representing degrees latitude and degrees longitude. Unless
1207 # specified otherwise, this must conform to the
1208 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1209 # standard&lt;/a&gt;. Values must be within normalized ranges.
1210 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1211 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1212 },
1213 },
1214 ],
1215 &quot;mid&quot;: &quot;A String&quot;, # Opaque entity ID. Some IDs may be available in
1216 # [Google Knowledge Graph Search
1217 # API](https://developers.google.com/knowledge-graph/).
1218 &quot;confidence&quot;: 3.14, # **Deprecated. Use `score` instead.**
1219 # The accuracy of the entity detection in an image.
1220 # For example, for an image in which the &quot;Eiffel Tower&quot; entity is detected,
1221 # this field represents the confidence that there is a tower in the query
1222 # image. Range [0, 1].
1223 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
1224 # for `LABEL_DETECTION` features.
1225 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1226 { # A vertex represents a 2D point in the image.
1227 # NOTE: the normalized vertex coordinates are relative to the original image
1228 # and range from 0 to 1.
1229 &quot;y&quot;: 3.14, # Y coordinate.
1230 &quot;x&quot;: 3.14, # X coordinate.
1231 },
1232 ],
1233 &quot;vertices&quot;: [ # The bounding polygon vertices.
1234 { # A vertex represents a 2D point in the image.
1235 # NOTE: the vertex coordinates are in the same scale as the original image.
1236 &quot;y&quot;: 42, # Y coordinate.
1237 &quot;x&quot;: 42, # X coordinate.
1238 },
1239 ],
1240 },
1241 &quot;locale&quot;: &quot;A String&quot;, # The language code for the locale in which the entity textual
1242 # `description` is expressed.
1243 &quot;description&quot;: &quot;A String&quot;, # Entity textual description, expressed in its `locale` language.
1244 &quot;topicality&quot;: 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
1245 # image. For example, the relevancy of &quot;tower&quot; is likely higher to an image
1246 # containing the detected &quot;Eiffel Tower&quot; than to an image containing a
1247 # detected distant towering building, even though the confidence that
1248 # there is a tower in each image may be the same. Range [0, 1].
1249 &quot;properties&quot;: [ # Some entities may have optional user-supplied `Property` (name/value)
1250 # fields, such a score or string that qualifies the entity.
1251 { # A `Property` consists of a user-supplied name/value pair.
1252 &quot;value&quot;: &quot;A String&quot;, # Value of the property.
1253 &quot;uint64Value&quot;: &quot;A String&quot;, # Value of numeric properties.
1254 &quot;name&quot;: &quot;A String&quot;, # Name of the property.
1255 },
1256 ],
1257 },
1258 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001259 },
1260 ],
1261 }</pre>
1262</div>
1263
1264<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001265 <code class="details" id="asyncBatchAnnotate">asyncBatchAnnotate(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001266 <pre>Run asynchronous image detection and annotation for a list of images.
1267
1268Progress and results can be retrieved through the
1269`google.longrunning.Operations` interface.
1270`Operation.metadata` contains `OperationMetadata` (metadata).
1271`Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
1272
1273This service will write image annotation outputs to json files in customer
1274GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
1275
1276Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001277 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001278 The object takes the form of:
1279
1280{ # Request for async image annotation for a list of images.
Bu Sun Kim65020912020-05-20 12:08:20 -07001281 &quot;outputConfig&quot;: { # The desired output location and metadata. # Required. The desired output location and metadata (e.g. format).
1282 &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.
1283 &quot;uri&quot;: &quot;A String&quot;, # Google Cloud Storage URI prefix where the results will be stored. Results
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001284 # will be in JSON format and preceded by its corresponding input URI prefix.
1285 # This field can either represent a gcs file prefix or gcs directory. In
1286 # either case, the uri should be unique because in order to get all of the
1287 # output files, you will need to do a wildcard gcs search on the uri prefix
1288 # you provide.
1289 #
1290 # Examples:
1291 #
1292 # * File Prefix: gs://bucket-name/here/filenameprefix The output files
1293 # will be created in gs://bucket-name/here/ and the names of the
Bu Sun Kim65020912020-05-20 12:08:20 -07001294 # output files will begin with &quot;filenameprefix&quot;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001295 #
1296 # * Directory Prefix: gs://bucket-name/some/location/ The output files
1297 # will be created in gs://bucket-name/some/location/ and the names of the
1298 # output files could be anything because there was no filename prefix
1299 # specified.
1300 #
1301 # If multiple outputs, each response is still AnnotateFileResponse, each of
1302 # which contains some subset of the full list of AnnotateImageResponse.
1303 # Multiple outputs can happen if, for example, the output JSON is too large
1304 # and overflows into multiple sharded files.
1305 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001306 &quot;batchSize&quot;: 42, # The max number of response protos to put into each output JSON file on
1307 # Google Cloud Storage.
1308 # The valid range is [1, 100]. If not specified, the default value is 20.
1309 #
1310 # For example, for one pdf file with 100 pages, 100 response protos will
1311 # be generated. If `batch_size` = 20, then 5 json files each
1312 # containing 20 response protos will be written under the prefix
1313 # `gcs_destination`.`uri`.
1314 #
1315 # Currently, batch_size only applies to GcsDestination, with potential future
1316 # support for other output configurations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001317 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001318 &quot;requests&quot;: [ # Required. Individual image annotation requests for this batch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001319 { # Request for performing Google Cloud Vision API tasks over a user-provided
1320 # image, with user-requested features, and with context information.
Bu Sun Kim65020912020-05-20 12:08:20 -07001321 &quot;image&quot;: { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
1322 &quot;content&quot;: &quot;A String&quot;, # Image content, represented as a stream of bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001323 # Note: As with all `bytes` fields, protobuffers use a pure binary
1324 # representation, whereas JSON representations use base64.
Bu Sun Kim65020912020-05-20 12:08:20 -07001325 &quot;source&quot;: { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001326 # URL. If both `content` and `source` are provided for an image, `content`
1327 # takes precedence and is used to perform the image annotation request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001328 &quot;gcsImageUri&quot;: &quot;A String&quot;, # **Use `image_uri` instead.**
1329 #
1330 # The Google Cloud Storage URI of the form
1331 # `gs://bucket_name/object_name`. Object versioning is not supported. See
1332 # [Google Cloud Storage Request
1333 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
Bu Sun Kim65020912020-05-20 12:08:20 -07001334 &quot;imageUri&quot;: &quot;A String&quot;, # The URI of the source image. Can be either:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001335 #
1336 # 1. A Google Cloud Storage URI of the form
1337 # `gs://bucket_name/object_name`. Object versioning is not supported. See
1338 # [Google Cloud Storage Request
1339 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
1340 # info.
1341 #
1342 # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
1343 # HTTP/HTTPS URLs, Google cannot guarantee that the request will be
1344 # completed. Your request may fail if the specified host denies the
1345 # request (e.g. due to request throttling or DOS prevention), or if Google
1346 # throttles requests to the site for abuse prevention. You should not
1347 # depend on externally-hosted images for production applications.
1348 #
1349 # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
1350 # precedence.
1351 },
1352 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001353 &quot;features&quot;: [ # Requested features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001354 { # The type of Google Cloud Vision API detection to perform, and the maximum
1355 # number of results to return for that type. Multiple `Feature` objects can
1356 # be specified in the `features` list.
Bu Sun Kim65020912020-05-20 12:08:20 -07001357 &quot;type&quot;: &quot;A String&quot;, # The feature type.
1358 &quot;maxResults&quot;: 42, # Maximum number of results of this type. Does not apply to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001359 # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001360 &quot;model&quot;: &quot;A String&quot;, # Model to use for the feature.
1361 # Supported values: &quot;builtin/stable&quot; (the default if unset) and
1362 # &quot;builtin/latest&quot;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001363 },
1364 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001365 &quot;imageContext&quot;: { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
1366 &quot;languageHints&quot;: [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
1367 # yields the best results since it enables automatic language detection. For
1368 # languages based on the Latin alphabet, setting `language_hints` is not
1369 # needed. In rare cases, when the language of the text in the image is known,
1370 # setting a hint will help get better results (although it will be a
1371 # significant hindrance if the hint is wrong). Text detection returns an
1372 # error if one or more of the specified languages is not one of the
1373 # [supported languages](https://cloud.google.com/vision/docs/languages).
1374 &quot;A String&quot;,
1375 ],
1376 &quot;webDetectionParams&quot;: { # Parameters for web detection request. # Parameters for web detection.
1377 &quot;includeGeoResults&quot;: True or False, # Whether to include results derived from the geo information in the image.
1378 },
1379 &quot;latLongRect&quot;: { # Rectangle determined by min and max `LatLng` pairs. # Not used.
1380 &quot;minLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Min lat/long pair.
1381 # of doubles representing degrees latitude and degrees longitude. Unless
1382 # specified otherwise, this must conform to the
1383 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1384 # standard&lt;/a&gt;. Values must be within normalized ranges.
1385 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1386 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1387 },
1388 &quot;maxLatLng&quot;: { # An object representing a latitude/longitude pair. This is expressed as a pair # Max lat/long pair.
1389 # of doubles representing degrees latitude and degrees longitude. Unless
1390 # specified otherwise, this must conform to the
1391 # &lt;a href=&quot;http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf&quot;&gt;WGS84
1392 # standard&lt;/a&gt;. Values must be within normalized ranges.
1393 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1394 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1395 },
1396 },
1397 &quot;cropHintsParams&quot;: { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
1398 &quot;aspectRatios&quot;: [ # Aspect ratios in floats, representing the ratio of the width to the height
1399 # of the image. For example, if the desired aspect ratio is 4/3, the
1400 # corresponding float value should be 1.33333. If not specified, the
1401 # best possible crop is returned. The number of provided aspect ratios is
1402 # limited to a maximum of 16; any aspect ratios provided after the 16th are
1403 # ignored.
1404 3.14,
1405 ],
1406 },
1407 &quot;productSearchParams&quot;: { # Parameters for a product search request. # Parameters for product search.
Bu Sun Kim65020912020-05-20 12:08:20 -07001408 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image.
1409 # If it is not specified, system discretion will be applied.
1410 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
1411 { # A vertex represents a 2D point in the image.
1412 # NOTE: the normalized vertex coordinates are relative to the original image
1413 # and range from 0 to 1.
1414 &quot;y&quot;: 3.14, # Y coordinate.
1415 &quot;x&quot;: 3.14, # X coordinate.
1416 },
1417 ],
1418 &quot;vertices&quot;: [ # The bounding polygon vertices.
1419 { # A vertex represents a 2D point in the image.
1420 # NOTE: the vertex coordinates are in the same scale as the original image.
1421 &quot;y&quot;: 42, # Y coordinate.
1422 &quot;x&quot;: 42, # X coordinate.
1423 },
1424 ],
1425 },
1426 &quot;productCategories&quot;: [ # The list of product categories to search in. Currently, we only consider
1427 # the first category, and either &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;, &quot;toys-v2&quot;,
1428 # &quot;packagedgoods-v1&quot;, or &quot;general-v1&quot; should be specified. The legacy
1429 # categories &quot;homegoods&quot;, &quot;apparel&quot;, and &quot;toys&quot; are still supported but will
1430 # be deprecated. For new products, please use &quot;homegoods-v2&quot;, &quot;apparel-v2&quot;,
1431 # or &quot;toys-v2&quot; for better product search accuracy. It is recommended to
1432 # migrate existing products to these categories as well.
1433 &quot;A String&quot;,
1434 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001435 &quot;filter&quot;: &quot;A String&quot;, # The filtering expression. This can be used to restrict search results based
1436 # on Product labels. We currently support an AND of OR of key-value
1437 # expressions, where each expression within an OR must have the same key. An
1438 # &#x27;=&#x27; should be used to connect the key and value.
1439 #
1440 # For example, &quot;(color = red OR color = blue) AND brand = Google&quot; is
1441 # acceptable, but &quot;(color = red OR brand = Google)&quot; is not acceptable.
1442 # &quot;color: red&quot; is not acceptable because it uses a &#x27;:&#x27; instead of an &#x27;=&#x27;.
1443 &quot;productSet&quot;: &quot;A String&quot;, # The resource name of a ProductSet to be searched for similar images.
1444 #
1445 # Format is:
1446 # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001447 },
1448 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001449 },
1450 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001451 &quot;parent&quot;: &quot;A String&quot;, # Optional. Target project and location to make a call.
1452 #
1453 # Format: `projects/{project-id}/locations/{location-id}`.
1454 #
1455 # If no parent is specified, a region will be chosen automatically.
1456 #
1457 # Supported location-ids:
1458 # `us`: USA country only,
1459 # `asia`: East asia areas, like Japan, Taiwan,
1460 # `eu`: The European Union.
1461 #
1462 # Example: `projects/project-A/locations/eu`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001463 }
1464
1465 x__xgafv: string, V1 error format.
1466 Allowed values
1467 1 - v1 error format
1468 2 - v2 error format
1469
1470Returns:
1471 An object of the form:
1472
1473 { # This resource represents a long-running operation that is the result of a
1474 # network API call.
Bu Sun Kim65020912020-05-20 12:08:20 -07001475 &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.
1476 # different programming environments, including REST APIs and RPC APIs. It is
1477 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1478 # three pieces of data: error code, error message, and error details.
1479 #
1480 # You can find out more about this error model and how to work with it in the
1481 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim65020912020-05-20 12:08:20 -07001482 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1483 # message types for APIs to use.
1484 {
1485 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1486 },
1487 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001488 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1489 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1490 # user-facing error message should be localized and sent in the
1491 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07001492 },
1493 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
1494 # contains progress information and common metadata such as create time.
1495 # Some services might not provide such metadata. Any method that returns a
1496 # long-running operation should document the metadata type, if any.
1497 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1498 },
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
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001503 # 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`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001510 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001511 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001512 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001513 # originally returns it. If you use the default HTTP mapping, the
1514 # `name` should be a resource name ending with `operations/{unique_id}`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001515 }</pre>
1516</div>
1517
1518</body></html>