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