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