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