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