blob: 0da1effa3d8bb5173c245fee3ba8a0290259bf60 [file] [log] [blame]
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -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
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070075<h1><a href="vision_v1.html">Cloud Vision API</a> . <a href="vision_v1.images.html">images</a></h1>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070076<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>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070079<p class="firstline">Run image detection and annotation for a batch of images.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070080<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>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070083<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>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070090 The object takes the form of:
91
92{ # Multiple image annotation requests are batched into a single service call.
Dan O'Mearadd494642020-05-01 07:42:23 -070093 "requests": [ # Required. Individual image annotation requests for this batch.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070094 { # Request for performing Google Cloud Vision API tasks over a user-provided
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070095 # image, with user-requested features, and with context information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080096 "imageContext": { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097 "latLongRect": { # Rectangle determined by min and max `LatLng` pairs. # Not used.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070098 "minLatLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # Min lat/long pair.
99 # of doubles representing degrees latitude and degrees longitude. Unless
100 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700101 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
102 # standard&lt;/a&gt;. Values must be within normalized ranges.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700103 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
104 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
105 },
106 "maxLatLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # Max lat/long pair.
107 # of doubles representing degrees latitude and degrees longitude. Unless
108 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
110 # standard&lt;/a&gt;. Values must be within normalized ranges.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700111 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
112 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
113 },
114 },
115 "languageHints": [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700116 # yields the best results since it enables automatic language detection. For
117 # languages based on the Latin alphabet, setting `language_hints` is not
118 # needed. In rare cases, when the language of the text in the image is known,
119 # setting a hint will help get better results (although it will be a
120 # significant hindrance if the hint is wrong). Text detection returns an
121 # error if one or more of the specified languages is not one of the
Dan O'Mearadd494642020-05-01 07:42:23 -0700122 # [supported languages](https://cloud.google.com/vision/docs/languages).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700123 "A String",
124 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700125 "productSearchParams": { # Parameters for a product search request. # Parameters for product search.
Dan O'Mearadd494642020-05-01 07:42:23 -0700126 "productCategories": [ # The list of product categories to search in. Currently, we only consider
127 # the first category, and either "homegoods-v2", "apparel-v2", "toys-v2",
128 # "packagedgoods-v1", or "general-v1" should be specified. The legacy
129 # categories "homegoods", "apparel", and "toys" are still supported but will
130 # be deprecated. For new products, please use "homegoods-v2", "apparel-v2",
131 # or "toys-v2" for better product search accuracy. It is recommended to
132 # migrate existing products to these categories as well.
133 "A String",
134 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700135 "filter": "A String", # The filtering expression. This can be used to restrict search results based
136 # on Product labels. We currently support an AND of OR of key-value
137 # expressions, where each expression within an OR must have the same key. An
138 # '=' should be used to connect the key and value.
139 #
140 # For example, "(color = red OR color = blue) AND brand = Google" is
141 # acceptable, but "(color = red OR brand = Google)" is not acceptable.
142 # "color: red" is not acceptable because it uses a ':' instead of an '='.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700143 "productSet": "A String", # The resource name of a ProductSet to be searched for similar images.
144 #
145 # Format is:
146 # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
147 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image.
Dan O'Mearadd494642020-05-01 07:42:23 -0700148 # If it is not specified, system discretion will be applied.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700149 "normalizedVertices": [ # The bounding polygon normalized vertices.
150 { # A vertex represents a 2D point in the image.
151 # NOTE: the normalized vertex coordinates are relative to the original image
152 # and range from 0 to 1.
153 "y": 3.14, # Y coordinate.
154 "x": 3.14, # X coordinate.
155 },
156 ],
157 "vertices": [ # The bounding polygon vertices.
158 { # A vertex represents a 2D point in the image.
159 # NOTE: the vertex coordinates are in the same scale as the original image.
160 "y": 42, # Y coordinate.
161 "x": 42, # X coordinate.
162 },
163 ],
164 },
165 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400166 "cropHintsParams": { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
167 "aspectRatios": [ # Aspect ratios in floats, representing the ratio of the width to the height
168 # of the image. For example, if the desired aspect ratio is 4/3, the
169 # corresponding float value should be 1.33333. If not specified, the
170 # best possible crop is returned. The number of provided aspect ratios is
171 # limited to a maximum of 16; any aspect ratios provided after the 16th are
172 # ignored.
173 3.14,
174 ],
175 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700176 "webDetectionParams": { # Parameters for web detection request. # Parameters for web detection.
177 "includeGeoResults": True or False, # Whether to include results derived from the geo information in the image.
178 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700179 },
180 "image": { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
181 "content": "A String", # Image content, represented as a stream of bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700182 # Note: As with all `bytes` fields, protobuffers use a pure binary
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700183 # representation, whereas JSON representations use base64.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700184 "source": { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image
185 # URL. If both `content` and `source` are provided for an image, `content`
186 # takes precedence and is used to perform the image annotation request.
187 "gcsImageUri": "A String", # **Use `image_uri` instead.**
188 #
189 # The Google Cloud Storage URI of the form
190 # `gs://bucket_name/object_name`. Object versioning is not supported. See
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400191 # [Google Cloud Storage Request
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700192 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
193 "imageUri": "A String", # The URI of the source image. Can be either:
194 #
195 # 1. A Google Cloud Storage URI of the form
196 # `gs://bucket_name/object_name`. Object versioning is not supported. See
197 # [Google Cloud Storage Request
198 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
199 # info.
200 #
201 # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
202 # HTTP/HTTPS URLs, Google cannot guarantee that the request will be
203 # completed. Your request may fail if the specified host denies the
204 # request (e.g. due to request throttling or DOS prevention), or if Google
205 # throttles requests to the site for abuse prevention. You should not
206 # depend on externally-hosted images for production applications.
207 #
208 # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400209 # precedence.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700210 },
211 },
212 "features": [ # Requested features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700213 { # The type of Google Cloud Vision API detection to perform, and the maximum
214 # number of results to return for that type. Multiple `Feature` objects can
215 # be specified in the `features` list.
216 "model": "A String", # Model to use for the feature.
217 # Supported values: "builtin/stable" (the default if unset) and
218 # "builtin/latest".
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700219 "type": "A String", # The feature type.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700220 "maxResults": 42, # Maximum number of results of this type. Does not apply to
221 # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700222 },
223 ],
224 },
225 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700226 "parent": "A String", # 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`.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -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.
249 "responses": [ # Individual responses to image annotation requests within the batch.
250 { # Response to an image annotation request.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400251 "safeSearchAnnotation": { # Set of features pertaining to the image, computed by computer vision # If present, safe-search annotation has completed successfully.
252 # methods over safe-search verticals (for example, adult, spoof, medical,
253 # violence).
Dan O'Mearadd494642020-05-01 07:42:23 -0700254 "medical": "A String", # Likelihood that this is a medical image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800255 "spoof": "A String", # Spoof likelihood. The likelihood that an modification
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700256 # was made to the image's canonical version to make it appear
257 # funny or offensive.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700258 "violence": "A String", # Likelihood that this image contains violent content.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700259 "adult": "A String", # Represents the adult content likelihood for the image. Adult content may
260 # contain elements such as nudity, pornographic images or cartoons, or
261 # sexual activities.
262 "racy": "A String", # Likelihood that the request image contains racy content. Racy content may
263 # include (but is not limited to) skimpy or sheer clothing, strategically
264 # covered nudity, lewd or provocative poses, or close-ups of sensitive
265 # body areas.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700266 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800267 "textAnnotations": [ # If present, text (OCR) detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700268 { # Set of detected entity features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700269 "confidence": 3.14, # **Deprecated. Use `score` instead.**
270 # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800271 # For example, for an image in which the "Eiffel Tower" entity is detected,
272 # this field represents the confidence that there is a tower in the query
273 # image. Range [0, 1].
274 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700275 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800276 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700277 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800278 # image. For example, the relevancy of "tower" is likely higher to an image
279 # containing the detected "Eiffel Tower" than to an image containing a
280 # detected distant towering building, even though the confidence that
281 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700282 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800283 # `LocationInfo` elements can be present because one location may
284 # indicate the location of the scene in the image, and another location
285 # may indicate the location of the place where the image was taken.
286 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700287 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800288 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700289 # of doubles representing degrees latitude and degrees longitude. Unless
290 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700291 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
292 # standard&lt;/a&gt;. Values must be within normalized ranges.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700293 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
294 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
295 },
296 },
297 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700298 "mid": "A String", # Opaque entity ID. Some IDs may be available in
299 # [Google Knowledge Graph Search
300 # API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700301 "score": 3.14, # Overall score of the result. Range [0, 1].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700302 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
303 # for `LABEL_DETECTION` features.
304 "normalizedVertices": [ # The bounding polygon normalized vertices.
305 { # A vertex represents a 2D point in the image.
306 # NOTE: the normalized vertex coordinates are relative to the original image
307 # and range from 0 to 1.
308 "y": 3.14, # Y coordinate.
309 "x": 3.14, # X coordinate.
310 },
311 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700312 "vertices": [ # The bounding polygon vertices.
313 { # A vertex represents a 2D point in the image.
314 # NOTE: the vertex coordinates are in the same scale as the original image.
315 "y": 42, # Y coordinate.
316 "x": 42, # X coordinate.
317 },
318 ],
319 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800320 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
321 # fields, such a score or string that qualifies the entity.
322 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400323 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700324 "name": "A String", # Name of the property.
325 "value": "A String", # Value of the property.
326 },
327 ],
328 },
329 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400330 "webDetection": { # Relevant information for the image from the Internet. # If present, web detection has completed successfully.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 "fullMatchingImages": [ # Fully matching images from the Internet.
332 # Can include resized copies of the query image.
333 { # Metadata for online images.
334 "url": "A String", # The result image URL.
335 "score": 3.14, # (Deprecated) Overall relevancy score for the image.
336 },
337 ],
338 "pagesWithMatchingImages": [ # Web pages containing the matching images from the Internet.
339 { # Metadata for web pages.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700340 "url": "A String", # The result web page URL.
Dan O'Mearadd494642020-05-01 07:42:23 -0700341 "pageTitle": "A String", # Title for the web page, may contain HTML markups.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700342 "score": 3.14, # (Deprecated) Overall relevancy score for the web page.
343 "partialMatchingImages": [ # Partial matching images on the page.
344 # Those images are similar enough to share some key-point features. For
345 # example an original image will likely have partial matching for its
346 # crops.
347 { # Metadata for online images.
348 "url": "A String", # The result image URL.
349 "score": 3.14, # (Deprecated) Overall relevancy score for the image.
350 },
351 ],
352 "fullMatchingImages": [ # Fully matching images on the page.
353 # Can include resized copies of the query image.
354 { # Metadata for online images.
355 "url": "A String", # The result image URL.
356 "score": 3.14, # (Deprecated) Overall relevancy score for the image.
357 },
358 ],
359 },
360 ],
361 "visuallySimilarImages": [ # The visually similar image results.
362 { # Metadata for online images.
363 "url": "A String", # The result image URL.
364 "score": 3.14, # (Deprecated) Overall relevancy score for the image.
365 },
366 ],
367 "partialMatchingImages": [ # Partial matching images from the Internet.
368 # Those images are similar enough to share some key-point features. For
369 # example an original image will likely have partial matching for its crops.
370 { # Metadata for online images.
371 "url": "A String", # The result image URL.
372 "score": 3.14, # (Deprecated) Overall relevancy score for the image.
373 },
374 ],
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700375 "webEntities": [ # Deduced entities from similar images on the Internet.
376 { # Entity deduced from similar images on the Internet.
377 "entityId": "A String", # Opaque entity ID.
378 "score": 3.14, # Overall relevancy score for the entity.
379 # Not normalized and not comparable across different image queries.
380 "description": "A String", # Canonical description of the entity, in English.
381 },
382 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700383 "bestGuessLabels": [ # The service's best guess as to the topic of the request image.
384 # Inferred from similar images on the open web.
385 { # Label to provide extra metadata for the web detection.
386 "languageCode": "A String", # The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
387 # For more information, see
388 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
389 "label": "A String", # Label for extra metadata.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400390 },
391 ],
392 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700393 "localizedObjectAnnotations": [ # If present, localized object detection has completed successfully.
394 # This will be sorted descending by confidence score.
395 { # Set of detected objects with bounding boxes.
396 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
397 # information, see
398 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
399 "score": 3.14, # Score of the result. Range [0, 1].
Dan O'Mearadd494642020-05-01 07:42:23 -0700400 "name": "A String", # Object name, expressed in its `language_code` language.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700401 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this object belongs. This must be populated.
402 "normalizedVertices": [ # The bounding polygon normalized vertices.
403 { # A vertex represents a 2D point in the image.
404 # NOTE: the normalized vertex coordinates are relative to the original image
405 # and range from 0 to 1.
406 "y": 3.14, # Y coordinate.
407 "x": 3.14, # X coordinate.
408 },
409 ],
410 "vertices": [ # The bounding polygon vertices.
411 { # A vertex represents a 2D point in the image.
412 # NOTE: the vertex coordinates are in the same scale as the original image.
413 "y": 42, # Y coordinate.
414 "x": 42, # X coordinate.
415 },
416 ],
417 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700418 "mid": "A String", # Object ID that should align with EntityAnnotation mid.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700419 },
420 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400421 "fullTextAnnotation": { # TextAnnotation contains a structured representation of OCR extracted text. # If present, text (OCR) detection or document (OCR) text detection has
422 # completed successfully.
423 # This annotation provides the structural hierarchy for the OCR detected
424 # text.
425 # The hierarchy of an OCR extracted text structure is like this:
Dan O'Mearadd494642020-05-01 07:42:23 -0700426 # TextAnnotation -&gt; Page -&gt; Block -&gt; Paragraph -&gt; Word -&gt; Symbol
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400427 # Each structural component, starting from Page, may further have their own
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700428 # properties. Properties describe detected languages, breaks etc.. Please refer
429 # to the TextAnnotation.TextProperty message definition below for more
430 # detail.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400431 "text": "A String", # UTF-8 text detected on the pages.
432 "pages": [ # List of pages detected by OCR.
433 { # Detected page from OCR.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700434 "width": 42, # Page width. For PDFs the unit is points. For images (including
435 # TIFFs) the unit is pixels.
436 "confidence": 3.14, # Confidence of the OCR results on the page. Range [0, 1].
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400437 "property": { # Additional information detected on the structural component. # Additional information detected on the page.
438 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400439 "type": "A String", # Detected break type.
Dan O'Mearadd494642020-05-01 07:42:23 -0700440 "isPrefix": True or False, # True if break prepends the element.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400441 },
442 "detectedLanguages": [ # A list of detected languages together with confidence.
443 { # Detected language for a structural component.
444 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
445 # information, see
446 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
447 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
448 },
449 ],
450 },
451 "blocks": [ # List of blocks of text, images etc on this page.
452 { # Logical element on the page.
453 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the block.
454 # The vertices are in the order of top-left, top-right, bottom-right,
455 # bottom-left. When a rotation of the bounding box is detected the rotation
456 # is represented as around the top-left corner as defined when the text is
457 # read in the 'natural' orientation.
458 # For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700459 #
460 # * when the text is horizontal it might look like:
461 #
462 # 0----1
463 # | |
464 # 3----2
465 #
466 # * when it's rotated 180 degrees around the top-left corner it becomes:
467 #
468 # 2----3
469 # | |
470 # 1----0
471 #
472 # and the vertex order will still be (0, 1, 2, 3).
473 "normalizedVertices": [ # The bounding polygon normalized vertices.
474 { # A vertex represents a 2D point in the image.
475 # NOTE: the normalized vertex coordinates are relative to the original image
476 # and range from 0 to 1.
477 "y": 3.14, # Y coordinate.
478 "x": 3.14, # X coordinate.
479 },
480 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400481 "vertices": [ # The bounding polygon vertices.
482 { # A vertex represents a 2D point in the image.
483 # NOTE: the vertex coordinates are in the same scale as the original image.
484 "y": 42, # Y coordinate.
485 "x": 42, # X coordinate.
486 },
487 ],
488 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700489 "blockType": "A String", # Detected block type (text, image etc) for this block.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400490 "property": { # Additional information detected on the structural component. # Additional information detected for the block.
491 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400492 "type": "A String", # Detected break type.
Dan O'Mearadd494642020-05-01 07:42:23 -0700493 "isPrefix": True or False, # True if break prepends the element.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400494 },
495 "detectedLanguages": [ # A list of detected languages together with confidence.
496 { # Detected language for a structural component.
497 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
498 # information, see
499 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
500 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
501 },
502 ],
503 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700504 "confidence": 3.14, # Confidence of the OCR results on the block. Range [0, 1].
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400505 "paragraphs": [ # List of paragraphs in this block (if this blocks is of type text).
506 { # Structural unit of text representing a number of words in certain order.
507 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the paragraph.
508 # The vertices are in the order of top-left, top-right, bottom-right,
509 # bottom-left. When a rotation of the bounding box is detected the rotation
510 # is represented as around the top-left corner as defined when the text is
511 # read in the 'natural' orientation.
512 # For example:
513 # * when the text is horizontal it might look like:
514 # 0----1
515 # | |
516 # 3----2
517 # * when it's rotated 180 degrees around the top-left corner it becomes:
518 # 2----3
519 # | |
520 # 1----0
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700521 # and the vertex order will still be (0, 1, 2, 3).
522 "normalizedVertices": [ # The bounding polygon normalized vertices.
523 { # A vertex represents a 2D point in the image.
524 # NOTE: the normalized vertex coordinates are relative to the original image
525 # and range from 0 to 1.
526 "y": 3.14, # Y coordinate.
527 "x": 3.14, # X coordinate.
528 },
529 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400530 "vertices": [ # The bounding polygon vertices.
531 { # A vertex represents a 2D point in the image.
532 # NOTE: the vertex coordinates are in the same scale as the original image.
533 "y": 42, # Y coordinate.
534 "x": 42, # X coordinate.
535 },
536 ],
537 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700538 "confidence": 3.14, # Confidence of the OCR results for the paragraph. Range [0, 1].
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400539 "property": { # Additional information detected on the structural component. # Additional information detected for the paragraph.
540 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400541 "type": "A String", # Detected break type.
Dan O'Mearadd494642020-05-01 07:42:23 -0700542 "isPrefix": True or False, # True if break prepends the element.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400543 },
544 "detectedLanguages": [ # A list of detected languages together with confidence.
545 { # Detected language for a structural component.
546 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
547 # information, see
548 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
549 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
550 },
551 ],
552 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700553 "words": [ # List of all words in this paragraph.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400554 { # A word representation.
555 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the word.
556 # The vertices are in the order of top-left, top-right, bottom-right,
557 # bottom-left. When a rotation of the bounding box is detected the rotation
558 # is represented as around the top-left corner as defined when the text is
559 # read in the 'natural' orientation.
560 # For example:
561 # * when the text is horizontal it might look like:
562 # 0----1
563 # | |
564 # 3----2
565 # * when it's rotated 180 degrees around the top-left corner it becomes:
566 # 2----3
567 # | |
568 # 1----0
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700569 # and the vertex order will still be (0, 1, 2, 3).
570 "normalizedVertices": [ # The bounding polygon normalized vertices.
571 { # A vertex represents a 2D point in the image.
572 # NOTE: the normalized vertex coordinates are relative to the original image
573 # and range from 0 to 1.
574 "y": 3.14, # Y coordinate.
575 "x": 3.14, # X coordinate.
576 },
577 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400578 "vertices": [ # The bounding polygon vertices.
579 { # A vertex represents a 2D point in the image.
580 # NOTE: the vertex coordinates are in the same scale as the original image.
581 "y": 42, # Y coordinate.
582 "x": 42, # X coordinate.
583 },
584 ],
585 },
586 "symbols": [ # List of symbols in the word.
587 # The order of the symbols follows the natural reading order.
588 { # A single symbol representation.
589 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the symbol.
590 # The vertices are in the order of top-left, top-right, bottom-right,
591 # bottom-left. When a rotation of the bounding box is detected the rotation
592 # is represented as around the top-left corner as defined when the text is
593 # read in the 'natural' orientation.
594 # For example:
595 # * when the text is horizontal it might look like:
596 # 0----1
597 # | |
598 # 3----2
599 # * when it's rotated 180 degrees around the top-left corner it becomes:
600 # 2----3
601 # | |
602 # 1----0
Dan O'Mearadd494642020-05-01 07:42:23 -0700603 # and the vertex order will still be (0, 1, 2, 3).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700604 "normalizedVertices": [ # The bounding polygon normalized vertices.
605 { # A vertex represents a 2D point in the image.
606 # NOTE: the normalized vertex coordinates are relative to the original image
607 # and range from 0 to 1.
608 "y": 3.14, # Y coordinate.
609 "x": 3.14, # X coordinate.
610 },
611 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400612 "vertices": [ # The bounding polygon vertices.
613 { # A vertex represents a 2D point in the image.
614 # NOTE: the vertex coordinates are in the same scale as the original image.
615 "y": 42, # Y coordinate.
616 "x": 42, # X coordinate.
617 },
618 ],
619 },
620 "text": "A String", # The actual UTF-8 representation of the symbol.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700621 "confidence": 3.14, # Confidence of the OCR results for the symbol. Range [0, 1].
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400622 "property": { # Additional information detected on the structural component. # Additional information detected for the symbol.
623 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400624 "type": "A String", # Detected break type.
Dan O'Mearadd494642020-05-01 07:42:23 -0700625 "isPrefix": True or False, # True if break prepends the element.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400626 },
627 "detectedLanguages": [ # A list of detected languages together with confidence.
628 { # Detected language for a structural component.
629 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
630 # information, see
631 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
632 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
633 },
634 ],
635 },
636 },
637 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700638 "confidence": 3.14, # Confidence of the OCR results for the word. Range [0, 1].
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400639 "property": { # Additional information detected on the structural component. # Additional information detected for the word.
640 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400641 "type": "A String", # Detected break type.
Dan O'Mearadd494642020-05-01 07:42:23 -0700642 "isPrefix": True or False, # True if break prepends the element.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400643 },
644 "detectedLanguages": [ # A list of detected languages together with confidence.
645 { # Detected language for a structural component.
646 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
647 # information, see
648 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
649 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
650 },
651 ],
652 },
653 },
654 ],
655 },
656 ],
657 },
658 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700659 "height": 42, # Page height. For PDFs the unit is points. For images (including
660 # TIFFs) the unit is pixels.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400661 },
662 ],
663 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800664 "labelAnnotations": [ # If present, label detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700665 { # Set of detected entity features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700666 "confidence": 3.14, # **Deprecated. Use `score` instead.**
667 # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800668 # For example, for an image in which the "Eiffel Tower" entity is detected,
669 # this field represents the confidence that there is a tower in the query
670 # image. Range [0, 1].
671 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700672 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800673 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700674 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800675 # image. For example, the relevancy of "tower" is likely higher to an image
676 # containing the detected "Eiffel Tower" than to an image containing a
677 # detected distant towering building, even though the confidence that
678 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700679 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800680 # `LocationInfo` elements can be present because one location may
681 # indicate the location of the scene in the image, and another location
682 # may indicate the location of the place where the image was taken.
683 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700684 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800685 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700686 # of doubles representing degrees latitude and degrees longitude. Unless
687 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700688 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
689 # standard&lt;/a&gt;. Values must be within normalized ranges.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700690 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
691 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
692 },
693 },
694 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700695 "mid": "A String", # Opaque entity ID. Some IDs may be available in
696 # [Google Knowledge Graph Search
697 # API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700698 "score": 3.14, # Overall score of the result. Range [0, 1].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700699 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
700 # for `LABEL_DETECTION` features.
701 "normalizedVertices": [ # The bounding polygon normalized vertices.
702 { # A vertex represents a 2D point in the image.
703 # NOTE: the normalized vertex coordinates are relative to the original image
704 # and range from 0 to 1.
705 "y": 3.14, # Y coordinate.
706 "x": 3.14, # X coordinate.
707 },
708 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700709 "vertices": [ # The bounding polygon vertices.
710 { # A vertex represents a 2D point in the image.
711 # NOTE: the vertex coordinates are in the same scale as the original image.
712 "y": 42, # Y coordinate.
713 "x": 42, # X coordinate.
714 },
715 ],
716 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800717 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
718 # fields, such a score or string that qualifies the entity.
719 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400720 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700721 "name": "A String", # Name of the property.
722 "value": "A String", # Value of the property.
723 },
724 ],
725 },
726 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800727 "imagePropertiesAnnotation": { # Stores image properties, such as dominant colors. # If present, image properties were extracted successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700728 "dominantColors": { # Set of dominant colors and their corresponding scores. # If present, dominant colors completed successfully.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800729 "colors": [ # RGB color values with their score and pixel fraction.
730 { # Color information consists of RGB channels, score, and the fraction of
731 # the image that the color occupies in the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700732 "color": { # Represents a color in the RGBA color space. This representation is designed # RGB components of the color.
733 # for simplicity of conversion to/from color representations in various
734 # languages over compactness; for example, the fields of this representation
735 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
736 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
737 # method in iOS; and, with just a little work, it can be easily formatted into
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700738 # a CSS "rgba()" string in JavaScript, as well.
739 #
740 # Note: this proto does not carry information about the absolute color space
741 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
742 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
743 # space.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700744 #
745 # Example (Java):
746 #
747 # import com.google.type.Color;
748 #
749 # // ...
750 # public static java.awt.Color fromProto(Color protocolor) {
751 # float alpha = protocolor.hasAlpha()
752 # ? protocolor.getAlpha().getValue()
753 # : 1.0;
754 #
755 # return new java.awt.Color(
756 # protocolor.getRed(),
757 # protocolor.getGreen(),
758 # protocolor.getBlue(),
759 # alpha);
760 # }
761 #
762 # public static Color toProto(java.awt.Color color) {
763 # float red = (float) color.getRed();
764 # float green = (float) color.getGreen();
765 # float blue = (float) color.getBlue();
766 # float denominator = 255.0;
767 # Color.Builder resultBuilder =
768 # Color
769 # .newBuilder()
770 # .setRed(red / denominator)
771 # .setGreen(green / denominator)
772 # .setBlue(blue / denominator);
773 # int alpha = color.getAlpha();
774 # if (alpha != 255) {
775 # result.setAlpha(
776 # FloatValue
777 # .newBuilder()
778 # .setValue(((float) alpha) / denominator)
779 # .build());
780 # }
781 # return resultBuilder.build();
782 # }
783 # // ...
784 #
785 # Example (iOS / Obj-C):
786 #
787 # // ...
788 # static UIColor* fromProto(Color* protocolor) {
789 # float red = [protocolor red];
790 # float green = [protocolor green];
791 # float blue = [protocolor blue];
792 # FloatValue* alpha_wrapper = [protocolor alpha];
793 # float alpha = 1.0;
794 # if (alpha_wrapper != nil) {
795 # alpha = [alpha_wrapper value];
796 # }
797 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
798 # }
799 #
800 # static Color* toProto(UIColor* color) {
801 # CGFloat red, green, blue, alpha;
Dan O'Mearadd494642020-05-01 07:42:23 -0700802 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700803 # return nil;
804 # }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700805 # Color* result = [[Color alloc] init];
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700806 # [result setRed:red];
807 # [result setGreen:green];
808 # [result setBlue:blue];
Dan O'Mearadd494642020-05-01 07:42:23 -0700809 # if (alpha &lt;= 0.9999) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700810 # [result setAlpha:floatWrapperWithValue(alpha)];
811 # }
812 # [result autorelease];
813 # return result;
814 # }
815 # // ...
816 #
817 # Example (JavaScript):
818 #
819 # // ...
820 #
821 # var protoToCssColor = function(rgb_color) {
822 # var redFrac = rgb_color.red || 0.0;
823 # var greenFrac = rgb_color.green || 0.0;
824 # var blueFrac = rgb_color.blue || 0.0;
825 # var red = Math.floor(redFrac * 255);
826 # var green = Math.floor(greenFrac * 255);
827 # var blue = Math.floor(blueFrac * 255);
828 #
829 # if (!('alpha' in rgb_color)) {
830 # return rgbToCssColor_(red, green, blue);
831 # }
832 #
833 # var alphaFrac = rgb_color.alpha.value || 0.0;
834 # var rgbParams = [red, green, blue].join(',');
835 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
836 # };
837 #
838 # var rgbToCssColor_ = function(red, green, blue) {
Dan O'Mearadd494642020-05-01 07:42:23 -0700839 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700840 # var hexString = rgbNumber.toString(16);
841 # var missingZeros = 6 - hexString.length;
842 # var resultBuilder = ['#'];
Dan O'Mearadd494642020-05-01 07:42:23 -0700843 # for (var i = 0; i &lt; missingZeros; i++) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700844 # resultBuilder.push('0');
845 # }
846 # resultBuilder.push(hexString);
847 # return resultBuilder.join('');
848 # };
849 #
850 # // ...
851 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
852 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
853 # the final pixel color is defined by the equation:
854 #
855 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
856 #
857 # This means that a value of 1.0 corresponds to a solid color, whereas
858 # a value of 0.0 corresponds to a completely transparent color. This
859 # uses a wrapper message rather than a simple float scalar so that it is
860 # possible to distinguish between a default value and the value being unset.
861 # If omitted, this color object is to be rendered as a solid color
862 # (as if the alpha value had been explicitly given with a value of 1.0).
863 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
864 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
865 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800866 "pixelFraction": 3.14, # The fraction of pixels the color occupies in the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700867 # Value in range [0, 1].
868 "score": 3.14, # Image-specific score for this color. Value in range [0, 1].
869 },
870 ],
871 },
872 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800873 "faceAnnotations": [ # If present, face detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700874 { # A face annotation object contains the results of face detection.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700875 "panAngle": 3.14, # Yaw angle, which indicates the leftward/rightward angle that the face is
876 # pointing relative to the vertical plane perpendicular to the image. Range
877 # [-180,180].
Dan O'Mearadd494642020-05-01 07:42:23 -0700878 "sorrowLikelihood": "A String", # Sorrow likelihood.
879 "landmarkingConfidence": 3.14, # Face landmarking confidence. Range [0, 1].
Thomas Coffee2f245372017-03-27 10:39:26 -0700880 "underExposedLikelihood": "A String", # Under-exposed likelihood.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700881 "detectionConfidence": 3.14, # Detection confidence. Range [0, 1].
882 "joyLikelihood": "A String", # Joy likelihood.
883 "landmarks": [ # Detected face landmarks.
884 { # A face-specific landmark (for example, a face feature).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700885 "position": { # A 3D position in the image, used primarily for Face detection landmarks. # Face landmark position.
886 # A valid Position must have both x and y coordinates.
887 # The position coordinates are in the same scale as the original image.
888 "y": 3.14, # Y coordinate.
889 "x": 3.14, # X coordinate.
890 "z": 3.14, # Z coordinate (or depth).
891 },
892 "type": "A String", # Face landmark type.
893 },
894 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700895 "surpriseLikelihood": "A String", # Surprise likelihood.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700896 "blurredLikelihood": "A String", # Blurred likelihood.
Thomas Coffee2f245372017-03-27 10:39:26 -0700897 "tiltAngle": 3.14, # Pitch angle, which indicates the upwards/downwards angle that the face is
898 # pointing relative to the image's horizontal plane. Range [-180,180].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700899 "angerLikelihood": "A String", # Anger likelihood.
900 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the face. The coordinates of the bounding box
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700901 # are in the original image's scale.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700902 # The bounding box is computed to "frame" the face in accordance with human
903 # expectations. It is based on the landmarker results.
904 # Note that one or more x and/or y coordinates may not be generated in the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800905 # `BoundingPoly` (the polygon will be unbounded) if only a partial face
906 # appears in the image to be annotated.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700907 "normalizedVertices": [ # The bounding polygon normalized vertices.
908 { # A vertex represents a 2D point in the image.
909 # NOTE: the normalized vertex coordinates are relative to the original image
910 # and range from 0 to 1.
911 "y": 3.14, # Y coordinate.
912 "x": 3.14, # X coordinate.
913 },
914 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700915 "vertices": [ # The bounding polygon vertices.
916 { # A vertex represents a 2D point in the image.
917 # NOTE: the vertex coordinates are in the same scale as the original image.
918 "y": 42, # Y coordinate.
919 "x": 42, # X coordinate.
920 },
921 ],
922 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800923 "rollAngle": 3.14, # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
924 # of the face relative to the image vertical about the axis perpendicular to
925 # the face. Range [-180,180].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700926 "headwearLikelihood": "A String", # Headwear likelihood.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800927 "fdBoundingPoly": { # A bounding polygon for the detected image annotation. # The `fd_bounding_poly` bounding polygon is tighter than the
928 # `boundingPoly`, and encloses only the skin part of the face. Typically, it
929 # is used to eliminate the face from any image analysis that detects the
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700930 # "amount of skin" visible in an image. It is not based on the
931 # landmarker results, only on the initial face detection, hence
Dan O'Mearadd494642020-05-01 07:42:23 -0700932 # the &lt;code&gt;fd&lt;/code&gt; (face detection) prefix.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700933 "normalizedVertices": [ # The bounding polygon normalized vertices.
934 { # A vertex represents a 2D point in the image.
935 # NOTE: the normalized vertex coordinates are relative to the original image
936 # and range from 0 to 1.
937 "y": 3.14, # Y coordinate.
938 "x": 3.14, # X coordinate.
939 },
940 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700941 "vertices": [ # The bounding polygon vertices.
942 { # A vertex represents a 2D point in the image.
943 # NOTE: the vertex coordinates are in the same scale as the original image.
944 "y": 42, # Y coordinate.
945 "x": 42, # X coordinate.
946 },
947 ],
948 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700949 },
950 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700951 "productSearchResults": { # Results for a product search request. # If present, product search has completed successfully.
952 "productGroupedResults": [ # List of results grouped by products detected in the query image. Each entry
953 # corresponds to one bounding polygon in the query image, and contains the
954 # matching products specific to that region. There may be duplicate product
955 # matches in the union of all the per-product results.
956 { # Information about the products similar to a single product in a query
957 # image.
Dan O'Mearadd494642020-05-01 07:42:23 -0700958 "objectAnnotations": [ # List of generic predictions for the object in the bounding box.
959 { # Prediction for what the object in the bounding box is.
960 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
961 # information, see
962 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
963 "score": 3.14, # Score of the result. Range [0, 1].
964 "mid": "A String", # Object ID that should align with EntityAnnotation mid.
965 "name": "A String", # Object name, expressed in its `language_code` language.
966 },
967 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700968 "results": [ # List of results, one for each product match.
969 { # Information about a product.
970 "image": "A String", # The resource name of the image from the product that is the closest match
971 # to the query.
972 "score": 3.14, # A confidence level on the match, ranging from 0 (no confidence) to
973 # 1 (full confidence).
974 "product": { # A Product contains ReferenceImages. # The Product.
975 "productLabels": [ # Key-value pairs that can be attached to a product. At query time,
976 # constraints can be specified based on the product_labels.
977 #
978 # Note that integer values can be provided as strings, e.g. "1199". Only
979 # strings with integer values can match a range-based restriction which is
980 # to be supported soon.
981 #
982 # Multiple values can be assigned to the same key. One product may have up to
Dan O'Mearadd494642020-05-01 07:42:23 -0700983 # 500 product_labels.
984 #
985 # Notice that the total number of distinct product_labels over all products
986 # in one ProductSet cannot exceed 1M, otherwise the product search pipeline
987 # will refuse to work for that ProductSet.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700988 { # A product label represented as a key-value pair.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700989 "value": "A String", # The value of the label attached to the product. Cannot be empty and
990 # cannot exceed 128 bytes.
Dan O'Mearadd494642020-05-01 07:42:23 -0700991 "key": "A String", # The key of the label attached to the product. Cannot be empty and cannot
992 # exceed 128 bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700993 },
994 ],
995 "displayName": "A String", # The user-provided name for this Product. Must not be empty. Must be at most
996 # 4096 characters long.
997 "name": "A String", # The resource name of the product.
998 #
999 # Format is:
1000 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
1001 #
1002 # This field is ignored when creating a product.
Dan O'Mearadd494642020-05-01 07:42:23 -07001003 "productCategory": "A String", # Immutable. The category for the product identified by the reference image. This should
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001004 # be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories
1005 # "homegoods", "apparel", and "toys" are still supported, but these should
1006 # not be used for new products.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001007 "description": "A String", # User-provided metadata to be stored with this product. Must be at most 4096
1008 # characters long.
1009 },
1010 },
1011 ],
1012 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the product detected in the query image.
1013 "normalizedVertices": [ # The bounding polygon normalized vertices.
1014 { # A vertex represents a 2D point in the image.
1015 # NOTE: the normalized vertex coordinates are relative to the original image
1016 # and range from 0 to 1.
1017 "y": 3.14, # Y coordinate.
1018 "x": 3.14, # X coordinate.
1019 },
1020 ],
1021 "vertices": [ # The bounding polygon vertices.
1022 { # A vertex represents a 2D point in the image.
1023 # NOTE: the vertex coordinates are in the same scale as the original image.
1024 "y": 42, # Y coordinate.
1025 "x": 42, # X coordinate.
1026 },
1027 ],
1028 },
1029 },
1030 ],
1031 "results": [ # List of results, one for each product match.
1032 { # Information about a product.
1033 "image": "A String", # The resource name of the image from the product that is the closest match
1034 # to the query.
1035 "score": 3.14, # A confidence level on the match, ranging from 0 (no confidence) to
1036 # 1 (full confidence).
1037 "product": { # A Product contains ReferenceImages. # The Product.
1038 "productLabels": [ # Key-value pairs that can be attached to a product. At query time,
1039 # constraints can be specified based on the product_labels.
1040 #
1041 # Note that integer values can be provided as strings, e.g. "1199". Only
1042 # strings with integer values can match a range-based restriction which is
1043 # to be supported soon.
1044 #
1045 # Multiple values can be assigned to the same key. One product may have up to
Dan O'Mearadd494642020-05-01 07:42:23 -07001046 # 500 product_labels.
1047 #
1048 # Notice that the total number of distinct product_labels over all products
1049 # in one ProductSet cannot exceed 1M, otherwise the product search pipeline
1050 # will refuse to work for that ProductSet.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001051 { # A product label represented as a key-value pair.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001052 "value": "A String", # The value of the label attached to the product. Cannot be empty and
1053 # cannot exceed 128 bytes.
Dan O'Mearadd494642020-05-01 07:42:23 -07001054 "key": "A String", # The key of the label attached to the product. Cannot be empty and cannot
1055 # exceed 128 bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001056 },
1057 ],
1058 "displayName": "A String", # The user-provided name for this Product. Must not be empty. Must be at most
1059 # 4096 characters long.
1060 "name": "A String", # The resource name of the product.
1061 #
1062 # Format is:
1063 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
1064 #
1065 # This field is ignored when creating a product.
Dan O'Mearadd494642020-05-01 07:42:23 -07001066 "productCategory": "A String", # Immutable. The category for the product identified by the reference image. This should
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001067 # be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories
1068 # "homegoods", "apparel", and "toys" are still supported, but these should
1069 # not be used for new products.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001070 "description": "A String", # User-provided metadata to be stored with this product. Must be at most 4096
1071 # characters long.
1072 },
1073 },
1074 ],
1075 "indexTime": "A String", # Timestamp of the index which provided these results. Products added to the
1076 # product set and products removed from the product set after this time are
1077 # not reflected in the current results.
1078 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001079 "logoAnnotations": [ # If present, logo detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001080 { # Set of detected entity features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001081 "confidence": 3.14, # **Deprecated. Use `score` instead.**
1082 # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001083 # For example, for an image in which the "Eiffel Tower" entity is detected,
1084 # this field represents the confidence that there is a tower in the query
1085 # image. Range [0, 1].
1086 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001087 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001088 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001089 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001090 # image. For example, the relevancy of "tower" is likely higher to an image
1091 # containing the detected "Eiffel Tower" than to an image containing a
1092 # detected distant towering building, even though the confidence that
1093 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001094 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001095 # `LocationInfo` elements can be present because one location may
1096 # indicate the location of the scene in the image, and another location
1097 # may indicate the location of the place where the image was taken.
1098 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001099 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001100 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001101 # of doubles representing degrees latitude and degrees longitude. Unless
1102 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001103 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
1104 # standard&lt;/a&gt;. Values must be within normalized ranges.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001105 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1106 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1107 },
1108 },
1109 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001110 "mid": "A String", # Opaque entity ID. Some IDs may be available in
1111 # [Google Knowledge Graph Search
1112 # API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001113 "score": 3.14, # Overall score of the result. Range [0, 1].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001114 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
1115 # for `LABEL_DETECTION` features.
1116 "normalizedVertices": [ # The bounding polygon normalized vertices.
1117 { # A vertex represents a 2D point in the image.
1118 # NOTE: the normalized vertex coordinates are relative to the original image
1119 # and range from 0 to 1.
1120 "y": 3.14, # Y coordinate.
1121 "x": 3.14, # X coordinate.
1122 },
1123 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001124 "vertices": [ # The bounding polygon vertices.
1125 { # A vertex represents a 2D point in the image.
1126 # NOTE: the vertex coordinates are in the same scale as the original image.
1127 "y": 42, # Y coordinate.
1128 "x": 42, # X coordinate.
1129 },
1130 ],
1131 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001132 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
1133 # fields, such a score or string that qualifies the entity.
1134 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001135 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001136 "name": "A String", # Name of the property.
1137 "value": "A String", # Value of the property.
1138 },
1139 ],
1140 },
1141 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001142 "landmarkAnnotations": [ # If present, landmark detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001143 { # Set of detected entity features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001144 "confidence": 3.14, # **Deprecated. Use `score` instead.**
1145 # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001146 # For example, for an image in which the "Eiffel Tower" entity is detected,
1147 # this field represents the confidence that there is a tower in the query
1148 # image. Range [0, 1].
1149 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001150 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001151 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001152 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001153 # image. For example, the relevancy of "tower" is likely higher to an image
1154 # containing the detected "Eiffel Tower" than to an image containing a
1155 # detected distant towering building, even though the confidence that
1156 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001157 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001158 # `LocationInfo` elements can be present because one location may
1159 # indicate the location of the scene in the image, and another location
1160 # may indicate the location of the place where the image was taken.
1161 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001162 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001163 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001164 # of doubles representing degrees latitude and degrees longitude. Unless
1165 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001166 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
1167 # standard&lt;/a&gt;. Values must be within normalized ranges.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001168 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1169 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1170 },
1171 },
1172 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001173 "mid": "A String", # Opaque entity ID. Some IDs may be available in
1174 # [Google Knowledge Graph Search
1175 # API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001176 "score": 3.14, # Overall score of the result. Range [0, 1].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001177 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced
1178 # for `LABEL_DETECTION` features.
1179 "normalizedVertices": [ # The bounding polygon normalized vertices.
1180 { # A vertex represents a 2D point in the image.
1181 # NOTE: the normalized vertex coordinates are relative to the original image
1182 # and range from 0 to 1.
1183 "y": 3.14, # Y coordinate.
1184 "x": 3.14, # X coordinate.
1185 },
1186 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001187 "vertices": [ # The bounding polygon vertices.
1188 { # A vertex represents a 2D point in the image.
1189 # NOTE: the vertex coordinates are in the same scale as the original image.
1190 "y": 42, # Y coordinate.
1191 "x": 42, # X coordinate.
1192 },
1193 ],
1194 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001195 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
1196 # fields, such a score or string that qualifies the entity.
1197 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001198 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001199 "name": "A String", # Name of the property.
1200 "value": "A String", # Value of the property.
1201 },
1202 ],
1203 },
1204 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001205 "context": { # 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
1206 # comes from.
1207 # information about the source of that image.
1208 "pageNumber": 42, # If the file was a PDF or TIFF, this field gives the page number within
1209 # the file used to produce the image.
1210 "uri": "A String", # The URI of the file used to produce the image.
1211 },
1212 "error": { # The `Status` type defines a logical error model that is suitable for # If set, represents the error message for the operation.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001213 # Note that filled-in image annotations are guaranteed to be
1214 # correct, even when `error` is set.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001215 # different programming environments, including REST APIs and RPC APIs. It is
1216 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1217 # three pieces of data: error code, error message, and error details.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001218 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001219 # You can find out more about this error model and how to work with it in the
1220 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001221 "message": "A String", # A developer-facing error message, which should be in English. Any
1222 # user-facing error message should be localized and sent in the
1223 # google.rpc.Status.details field, or localized by the client.
1224 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001225 "details": [ # A list of messages that carry the error details. There is a common set of
1226 # message types for APIs to use.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001227 {
1228 "a_key": "", # Properties of the object. Contains field @type with type URL.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001229 },
1230 ],
1231 },
1232 "cropHintsAnnotation": { # Set of crop hints that are used to generate new crops when serving images. # If present, crop hints have completed successfully.
1233 "cropHints": [ # Crop hint results.
1234 { # Single crop hint that is used to generate a new crop when serving an image.
1235 "confidence": 3.14, # Confidence of this being a salient region. Range [0, 1].
1236 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon for the crop region. The coordinates of the bounding
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001237 # box are in the original image's scale.
1238 "normalizedVertices": [ # The bounding polygon normalized vertices.
1239 { # A vertex represents a 2D point in the image.
1240 # NOTE: the normalized vertex coordinates are relative to the original image
1241 # and range from 0 to 1.
1242 "y": 3.14, # Y coordinate.
1243 "x": 3.14, # X coordinate.
1244 },
1245 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001246 "vertices": [ # The bounding polygon vertices.
1247 { # A vertex represents a 2D point in the image.
1248 # NOTE: the vertex coordinates are in the same scale as the original image.
1249 "y": 42, # Y coordinate.
1250 "x": 42, # X coordinate.
1251 },
1252 ],
1253 },
1254 "importanceFraction": 3.14, # Fraction of importance of this salient region with respect to the original
1255 # image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001256 },
1257 ],
1258 },
1259 },
1260 ],
1261 }</pre>
1262</div>
1263
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001264<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.
1281 "outputConfig": { # The desired output location and metadata. # Required. The desired output location and metadata (e.g. format).
1282 "batchSize": 42, # The max number of response protos to put into each output JSON file on
1283 # Google Cloud Storage.
1284 # The valid range is [1, 100]. If not specified, the default value is 20.
1285 #
1286 # For example, for one pdf file with 100 pages, 100 response protos will
1287 # be generated. If `batch_size` = 20, then 5 json files each
1288 # containing 20 response protos will be written under the prefix
1289 # `gcs_destination`.`uri`.
1290 #
1291 # Currently, batch_size only applies to GcsDestination, with potential future
1292 # support for other output configurations.
1293 "gcsDestination": { # The Google Cloud Storage location where the output will be written to. # The Google Cloud Storage location to write the output(s) to.
1294 "uri": "A String", # Google Cloud Storage URI prefix where the results will be stored. Results
1295 # will be in JSON format and preceded by its corresponding input URI prefix.
1296 # This field can either represent a gcs file prefix or gcs directory. In
1297 # either case, the uri should be unique because in order to get all of the
1298 # output files, you will need to do a wildcard gcs search on the uri prefix
1299 # you provide.
1300 #
1301 # Examples:
1302 #
1303 # * File Prefix: gs://bucket-name/here/filenameprefix The output files
1304 # will be created in gs://bucket-name/here/ and the names of the
1305 # output files will begin with "filenameprefix".
1306 #
1307 # * Directory Prefix: gs://bucket-name/some/location/ The output files
1308 # will be created in gs://bucket-name/some/location/ and the names of the
1309 # output files could be anything because there was no filename prefix
1310 # specified.
1311 #
1312 # If multiple outputs, each response is still AnnotateFileResponse, each of
1313 # which contains some subset of the full list of AnnotateImageResponse.
1314 # Multiple outputs can happen if, for example, the output JSON is too large
1315 # and overflows into multiple sharded files.
1316 },
1317 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001318 "requests": [ # 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.
1321 "imageContext": { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
1322 "latLongRect": { # Rectangle determined by min and max `LatLng` pairs. # Not used.
1323 "minLatLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # Min lat/long pair.
1324 # of doubles representing degrees latitude and degrees longitude. Unless
1325 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001326 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
1327 # standard&lt;/a&gt;. Values must be within normalized ranges.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001328 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1329 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1330 },
1331 "maxLatLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # Max lat/long pair.
1332 # of doubles representing degrees latitude and degrees longitude. Unless
1333 # specified otherwise, this must conform to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001334 # &lt;a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf"&gt;WGS84
1335 # standard&lt;/a&gt;. Values must be within normalized ranges.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001336 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1337 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1338 },
1339 },
1340 "languageHints": [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
1341 # yields the best results since it enables automatic language detection. For
1342 # languages based on the Latin alphabet, setting `language_hints` is not
1343 # needed. In rare cases, when the language of the text in the image is known,
1344 # setting a hint will help get better results (although it will be a
1345 # significant hindrance if the hint is wrong). Text detection returns an
1346 # error if one or more of the specified languages is not one of the
Dan O'Mearadd494642020-05-01 07:42:23 -07001347 # [supported languages](https://cloud.google.com/vision/docs/languages).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001348 "A String",
1349 ],
1350 "productSearchParams": { # Parameters for a product search request. # Parameters for product search.
Dan O'Mearadd494642020-05-01 07:42:23 -07001351 "productCategories": [ # The list of product categories to search in. Currently, we only consider
1352 # the first category, and either "homegoods-v2", "apparel-v2", "toys-v2",
1353 # "packagedgoods-v1", or "general-v1" should be specified. The legacy
1354 # categories "homegoods", "apparel", and "toys" are still supported but will
1355 # be deprecated. For new products, please use "homegoods-v2", "apparel-v2",
1356 # or "toys-v2" for better product search accuracy. It is recommended to
1357 # migrate existing products to these categories as well.
1358 "A String",
1359 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001360 "filter": "A String", # The filtering expression. This can be used to restrict search results based
1361 # on Product labels. We currently support an AND of OR of key-value
1362 # expressions, where each expression within an OR must have the same key. An
1363 # '=' should be used to connect the key and value.
1364 #
1365 # For example, "(color = red OR color = blue) AND brand = Google" is
1366 # acceptable, but "(color = red OR brand = Google)" is not acceptable.
1367 # "color: red" is not acceptable because it uses a ':' instead of an '='.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001368 "productSet": "A String", # The resource name of a ProductSet to be searched for similar images.
1369 #
1370 # Format is:
1371 # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
1372 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image.
Dan O'Mearadd494642020-05-01 07:42:23 -07001373 # If it is not specified, system discretion will be applied.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001374 "normalizedVertices": [ # The bounding polygon normalized vertices.
1375 { # A vertex represents a 2D point in the image.
1376 # NOTE: the normalized vertex coordinates are relative to the original image
1377 # and range from 0 to 1.
1378 "y": 3.14, # Y coordinate.
1379 "x": 3.14, # X coordinate.
1380 },
1381 ],
1382 "vertices": [ # The bounding polygon vertices.
1383 { # A vertex represents a 2D point in the image.
1384 # NOTE: the vertex coordinates are in the same scale as the original image.
1385 "y": 42, # Y coordinate.
1386 "x": 42, # X coordinate.
1387 },
1388 ],
1389 },
1390 },
1391 "cropHintsParams": { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
1392 "aspectRatios": [ # Aspect ratios in floats, representing the ratio of the width to the height
1393 # of the image. For example, if the desired aspect ratio is 4/3, the
1394 # corresponding float value should be 1.33333. If not specified, the
1395 # best possible crop is returned. The number of provided aspect ratios is
1396 # limited to a maximum of 16; any aspect ratios provided after the 16th are
1397 # ignored.
1398 3.14,
1399 ],
1400 },
1401 "webDetectionParams": { # Parameters for web detection request. # Parameters for web detection.
1402 "includeGeoResults": True or False, # Whether to include results derived from the geo information in the image.
1403 },
1404 },
1405 "image": { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
1406 "content": "A String", # Image content, represented as a stream of bytes.
1407 # Note: As with all `bytes` fields, protobuffers use a pure binary
1408 # representation, whereas JSON representations use base64.
1409 "source": { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image
1410 # URL. If both `content` and `source` are provided for an image, `content`
1411 # takes precedence and is used to perform the image annotation request.
1412 "gcsImageUri": "A String", # **Use `image_uri` instead.**
1413 #
1414 # The Google Cloud Storage URI of the form
1415 # `gs://bucket_name/object_name`. Object versioning is not supported. See
1416 # [Google Cloud Storage Request
1417 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
1418 "imageUri": "A String", # The URI of the source image. Can be either:
1419 #
1420 # 1. A Google Cloud Storage URI of the form
1421 # `gs://bucket_name/object_name`. Object versioning is not supported. See
1422 # [Google Cloud Storage Request
1423 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
1424 # info.
1425 #
1426 # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
1427 # HTTP/HTTPS URLs, Google cannot guarantee that the request will be
1428 # completed. Your request may fail if the specified host denies the
1429 # request (e.g. due to request throttling or DOS prevention), or if Google
1430 # throttles requests to the site for abuse prevention. You should not
1431 # depend on externally-hosted images for production applications.
1432 #
1433 # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
1434 # precedence.
1435 },
1436 },
1437 "features": [ # Requested features.
1438 { # The type of Google Cloud Vision API detection to perform, and the maximum
1439 # number of results to return for that type. Multiple `Feature` objects can
1440 # be specified in the `features` list.
1441 "model": "A String", # Model to use for the feature.
1442 # Supported values: "builtin/stable" (the default if unset) and
1443 # "builtin/latest".
1444 "type": "A String", # The feature type.
1445 "maxResults": 42, # Maximum number of results of this type. Does not apply to
1446 # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
1447 },
1448 ],
1449 },
1450 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001451 "parent": "A String", # 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.
1475 "response": { # The normal response of the operation in case of success. If the original
1476 # method returns no data on success, such as `Delete`, the response is
1477 # `google.protobuf.Empty`. If the original method is standard
1478 # `Get`/`Create`/`Update`, the response should be the resource. For other
1479 # methods, the response should have the type `XxxResponse`, where `Xxx`
1480 # is the original method name. For example, if the original method name
1481 # is `TakeSnapshot()`, the inferred response type is
1482 # `TakeSnapshotResponse`.
1483 "a_key": "", # Properties of the object. Contains field @type with type URL.
1484 },
1485 "metadata": { # Service-specific metadata associated with the operation. It typically
1486 # contains progress information and common metadata such as create time.
1487 # Some services might not provide such metadata. Any method that returns a
1488 # long-running operation should document the metadata type, if any.
1489 "a_key": "", # Properties of the object. Contains field @type with type URL.
1490 },
1491 "done": True or False, # If the value is `false`, it means the operation is still in progress.
1492 # If `true`, the operation is completed, and either `error` or `response` is
1493 # available.
1494 "name": "A String", # The server-assigned name, which is only unique within the same service that
1495 # originally returns it. If you use the default HTTP mapping, the
1496 # `name` should be a resource name ending with `operations/{unique_id}`.
1497 "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
1498 # different programming environments, including REST APIs and RPC APIs. It is
1499 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1500 # three pieces of data: error code, error message, and error details.
1501 #
1502 # You can find out more about this error model and how to work with it in the
1503 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1504 "message": "A String", # A developer-facing error message, which should be in English. Any
1505 # user-facing error message should be localized and sent in the
1506 # google.rpc.Status.details field, or localized by the client.
1507 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1508 "details": [ # A list of messages that carry the error details. There is a common set of
1509 # message types for APIs to use.
1510 {
1511 "a_key": "", # Properties of the object. Contains field @type with type URL.
1512 },
1513 ],
1514 },
1515 }</pre>
1516</div>
1517
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001518</body></html>