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