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