Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 75 | <h1><a href="vision_v1.html">Cloud Vision API</a> . <a href="vision_v1.images.html">images</a></h1> |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 78 | <code><a href="#annotate">annotate(body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 79 | <p class="firstline">Run image detection and annotation for a batch of images.</p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 80 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 81 | <code><a href="#asyncBatchAnnotate">asyncBatchAnnotate(body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 82 | <p class="firstline">Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#close">close()</a></code></p> |
| 85 | <p class="firstline">Close httplib2 connections.</p> |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 86 | <h3>Method Details</h3> |
| 87 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 88 | <code class="details" id="annotate">annotate(body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 89 | <pre>Run image detection and annotation for a batch of images. |
| 90 | |
| 91 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 92 | body: object, The request body. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 93 | The object takes the form of: |
| 94 | |
| 95 | { # Multiple image annotation requests are batched into a single service call. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 96 | "parent": "A String", # Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`. |
| 97 | "requests": [ # Required. Individual image annotation requests for this batch. |
| 98 | { # Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information. |
| 99 | "features": [ # Requested features. |
| 100 | { # The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple `Feature` objects can be specified in the `features` list. |
| 101 | "maxResults": 42, # Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. |
| 102 | "model": "A String", # Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest". |
| 103 | "type": "A String", # The feature type. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 104 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 105 | ], |
| 106 | "image": { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed. |
| 107 | "content": "A String", # Image content, represented as a stream of bytes. Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests. |
| 108 | "source": { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image URL. If both `content` and `source` are provided for an image, `content` takes precedence and is used to perform the image annotation request. |
| 109 | "gcsImageUri": "A String", # **Use `image_uri` instead.** The Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. |
| 110 | "imageUri": "A String", # The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from HTTP/HTTPS URLs, Google cannot guarantee that the request will be completed. Your request may fail if the specified host denies the request (e.g. due to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes precedence. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 111 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 112 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 113 | "imageContext": { # Image context and/or feature-specific parameters. # Additional context that may accompany the image. |
| 114 | "cropHintsParams": { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request. |
| 115 | "aspectRatios": [ # Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored. |
| 116 | 3.14, |
| 117 | ], |
| 118 | }, |
| 119 | "languageHints": [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the [supported languages](https://cloud.google.com/vision/docs/languages). |
| 120 | "A String", |
| 121 | ], |
| 122 | "latLongRect": { # Rectangle determined by min and max `LatLng` pairs. # Not used. |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 123 | "maxLatLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # Max lat/long pair. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 124 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 125 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
| 126 | }, |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 127 | "minLatLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # Min lat/long pair. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 128 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 129 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
| 130 | }, |
| 131 | }, |
| 132 | "productSearchParams": { # Parameters for a product search request. # Parameters for product search. |
| 133 | "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied. |
| 134 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 135 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 136 | "x": 3.14, # X coordinate. |
| 137 | "y": 3.14, # Y coordinate. |
| 138 | }, |
| 139 | ], |
| 140 | "vertices": [ # The bounding polygon vertices. |
| 141 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 142 | "x": 42, # X coordinate. |
| 143 | "y": 42, # Y coordinate. |
| 144 | }, |
| 145 | ], |
| 146 | }, |
| 147 | "filter": "A String", # The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value. For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='. |
| 148 | "productCategories": [ # The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well. |
| 149 | "A String", |
| 150 | ], |
| 151 | "productSet": "A String", # The resource name of a ProductSet to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. |
| 152 | }, |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 153 | "textDetectionParams": { # Parameters for text detections. This is used to control TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. # Parameters for text detection and document text detection. |
| 154 | "enableTextDetectionConfidenceScore": True or False, # By default, Cloud Vision API only includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence score for TEXT_DETECTION as well. |
| 155 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 156 | "webDetectionParams": { # Parameters for web detection request. # Parameters for web detection. |
| 157 | "includeGeoResults": True or False, # Whether to include results derived from the geo information in the image. |
| 158 | }, |
| 159 | }, |
| 160 | }, |
| 161 | ], |
| 162 | } |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 163 | |
| 164 | x__xgafv: string, V1 error format. |
| 165 | Allowed values |
| 166 | 1 - v1 error format |
| 167 | 2 - v2 error format |
| 168 | |
| 169 | Returns: |
| 170 | An object of the form: |
| 171 | |
| 172 | { # Response to a batch image annotation request. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 173 | "responses": [ # Individual responses to image annotation requests within the batch. |
| 174 | { # Response to an image annotation request. |
| 175 | "context": { # If an image was produced from a file (e.g. a PDF), this message gives information about the source of that image. # If present, contextual information is needed to understand where this image comes from. |
| 176 | "pageNumber": 42, # If the file was a PDF or TIFF, this field gives the page number within the file used to produce the image. |
| 177 | "uri": "A String", # The URI of the file used to produce the image. |
| 178 | }, |
| 179 | "cropHintsAnnotation": { # Set of crop hints that are used to generate new crops when serving images. # If present, crop hints have completed successfully. |
| 180 | "cropHints": [ # Crop hint results. |
| 181 | { # Single crop hint that is used to generate a new crop when serving an image. |
| 182 | "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon for the crop region. The coordinates of the bounding box are in the original image's scale. |
| 183 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 184 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 185 | "x": 3.14, # X coordinate. |
| 186 | "y": 3.14, # Y coordinate. |
| 187 | }, |
| 188 | ], |
| 189 | "vertices": [ # The bounding polygon vertices. |
| 190 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 191 | "x": 42, # X coordinate. |
| 192 | "y": 42, # Y coordinate. |
| 193 | }, |
| 194 | ], |
| 195 | }, |
| 196 | "confidence": 3.14, # Confidence of this being a salient region. Range [0, 1]. |
| 197 | "importanceFraction": 3.14, # Fraction of importance of this salient region with respect to the original image. |
| 198 | }, |
| 199 | ], |
| 200 | }, |
| 201 | "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when `error` is set. |
| 202 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 203 | "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use. |
| 204 | { |
| 205 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 206 | }, |
| 207 | ], |
| 208 | "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. |
| 209 | }, |
| 210 | "faceAnnotations": [ # If present, face detection has completed successfully. |
| 211 | { # A face annotation object contains the results of face detection. |
| 212 | "angerLikelihood": "A String", # Anger likelihood. |
| 213 | "blurredLikelihood": "A String", # Blurred likelihood. |
| 214 | "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the `BoundingPoly` (the polygon will be unbounded) if only a partial face appears in the image to be annotated. |
| 215 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 216 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 217 | "x": 3.14, # X coordinate. |
| 218 | "y": 3.14, # Y coordinate. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 219 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 220 | ], |
| 221 | "vertices": [ # The bounding polygon vertices. |
| 222 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 223 | "x": 42, # X coordinate. |
| 224 | "y": 42, # Y coordinate. |
| 225 | }, |
| 226 | ], |
| 227 | }, |
| 228 | "detectionConfidence": 3.14, # Detection confidence. Range [0, 1]. |
| 229 | "fdBoundingPoly": { # A bounding polygon for the detected image annotation. # The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that detects the "amount of skin" visible in an image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix. |
| 230 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 231 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 232 | "x": 3.14, # X coordinate. |
| 233 | "y": 3.14, # Y coordinate. |
| 234 | }, |
| 235 | ], |
| 236 | "vertices": [ # The bounding polygon vertices. |
| 237 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 238 | "x": 42, # X coordinate. |
| 239 | "y": 42, # Y coordinate. |
| 240 | }, |
| 241 | ], |
| 242 | }, |
| 243 | "headwearLikelihood": "A String", # Headwear likelihood. |
| 244 | "joyLikelihood": "A String", # Joy likelihood. |
| 245 | "landmarkingConfidence": 3.14, # Face landmarking confidence. Range [0, 1]. |
| 246 | "landmarks": [ # Detected face landmarks. |
| 247 | { # A face-specific landmark (for example, a face feature). |
| 248 | "position": { # A 3D position in the image, used primarily for Face detection landmarks. A valid Position must have both x and y coordinates. The position coordinates are in the same scale as the original image. # Face landmark position. |
| 249 | "x": 3.14, # X coordinate. |
| 250 | "y": 3.14, # Y coordinate. |
| 251 | "z": 3.14, # Z coordinate (or depth). |
| 252 | }, |
| 253 | "type": "A String", # Face landmark type. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 254 | }, |
| 255 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 256 | "panAngle": 3.14, # Yaw angle, which indicates the leftward/rightward angle that the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180]. |
| 257 | "rollAngle": 3.14, # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180]. |
| 258 | "sorrowLikelihood": "A String", # Sorrow likelihood. |
| 259 | "surpriseLikelihood": "A String", # Surprise likelihood. |
| 260 | "tiltAngle": 3.14, # Pitch angle, which indicates the upwards/downwards angle that the face is pointing relative to the image's horizontal plane. Range [-180,180]. |
| 261 | "underExposedLikelihood": "A String", # Under-exposed likelihood. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 262 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 263 | ], |
| 264 | "fullTextAnnotation": { # TextAnnotation contains a structured representation of OCR extracted text. The hierarchy of an OCR extracted text structure is like this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the TextAnnotation.TextProperty message definition below for more detail. # If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text. |
| 265 | "pages": [ # List of pages detected by OCR. |
| 266 | { # Detected page from OCR. |
| 267 | "blocks": [ # List of blocks of text, images etc on this page. |
| 268 | { # Logical element on the page. |
| 269 | "blockType": "A String", # Detected block type (text, image etc) for this block. |
| 270 | "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). |
| 271 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 272 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 273 | "x": 3.14, # X coordinate. |
| 274 | "y": 3.14, # Y coordinate. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 275 | }, |
| 276 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 277 | "vertices": [ # The bounding polygon vertices. |
| 278 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 279 | "x": 42, # X coordinate. |
| 280 | "y": 42, # Y coordinate. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 281 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 282 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 283 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 284 | "confidence": 3.14, # Confidence of the OCR results on the block. Range [0, 1]. |
| 285 | "paragraphs": [ # List of paragraphs in this block (if this blocks is of type text). |
| 286 | { # Structural unit of text representing a number of words in certain order. |
| 287 | "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the paragraph. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). |
| 288 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 289 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 290 | "x": 3.14, # X coordinate. |
| 291 | "y": 3.14, # Y coordinate. |
| 292 | }, |
| 293 | ], |
| 294 | "vertices": [ # The bounding polygon vertices. |
| 295 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 296 | "x": 42, # X coordinate. |
| 297 | "y": 42, # Y coordinate. |
| 298 | }, |
| 299 | ], |
| 300 | }, |
| 301 | "confidence": 3.14, # Confidence of the OCR results for the paragraph. Range [0, 1]. |
| 302 | "property": { # Additional information detected on the structural component. # Additional information detected for the paragraph. |
| 303 | "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment. |
| 304 | "isPrefix": True or False, # True if break prepends the element. |
| 305 | "type": "A String", # Detected break type. |
| 306 | }, |
| 307 | "detectedLanguages": [ # A list of detected languages together with confidence. |
| 308 | { # Detected language for a structural component. |
| 309 | "confidence": 3.14, # Confidence of detected language. Range [0, 1]. |
| 310 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
| 311 | }, |
| 312 | ], |
| 313 | }, |
| 314 | "words": [ # List of all words in this paragraph. |
| 315 | { # A word representation. |
| 316 | "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the word. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). |
| 317 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 318 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 319 | "x": 3.14, # X coordinate. |
| 320 | "y": 3.14, # Y coordinate. |
| 321 | }, |
| 322 | ], |
| 323 | "vertices": [ # The bounding polygon vertices. |
| 324 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 325 | "x": 42, # X coordinate. |
| 326 | "y": 42, # Y coordinate. |
| 327 | }, |
| 328 | ], |
| 329 | }, |
| 330 | "confidence": 3.14, # Confidence of the OCR results for the word. Range [0, 1]. |
| 331 | "property": { # Additional information detected on the structural component. # Additional information detected for the word. |
| 332 | "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment. |
| 333 | "isPrefix": True or False, # True if break prepends the element. |
| 334 | "type": "A String", # Detected break type. |
| 335 | }, |
| 336 | "detectedLanguages": [ # A list of detected languages together with confidence. |
| 337 | { # Detected language for a structural component. |
| 338 | "confidence": 3.14, # Confidence of detected language. Range [0, 1]. |
| 339 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
| 340 | }, |
| 341 | ], |
| 342 | }, |
| 343 | "symbols": [ # List of symbols in the word. The order of the symbols follows the natural reading order. |
| 344 | { # A single symbol representation. |
| 345 | "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the symbol. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3). |
| 346 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 347 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 348 | "x": 3.14, # X coordinate. |
| 349 | "y": 3.14, # Y coordinate. |
| 350 | }, |
| 351 | ], |
| 352 | "vertices": [ # The bounding polygon vertices. |
| 353 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 354 | "x": 42, # X coordinate. |
| 355 | "y": 42, # Y coordinate. |
| 356 | }, |
| 357 | ], |
| 358 | }, |
| 359 | "confidence": 3.14, # Confidence of the OCR results for the symbol. Range [0, 1]. |
| 360 | "property": { # Additional information detected on the structural component. # Additional information detected for the symbol. |
| 361 | "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment. |
| 362 | "isPrefix": True or False, # True if break prepends the element. |
| 363 | "type": "A String", # Detected break type. |
| 364 | }, |
| 365 | "detectedLanguages": [ # A list of detected languages together with confidence. |
| 366 | { # Detected language for a structural component. |
| 367 | "confidence": 3.14, # Confidence of detected language. Range [0, 1]. |
| 368 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
| 369 | }, |
| 370 | ], |
| 371 | }, |
| 372 | "text": "A String", # The actual UTF-8 representation of the symbol. |
| 373 | }, |
| 374 | ], |
| 375 | }, |
| 376 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 377 | }, |
| 378 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 379 | "property": { # Additional information detected on the structural component. # Additional information detected for the block. |
| 380 | "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment. |
| 381 | "isPrefix": True or False, # True if break prepends the element. |
| 382 | "type": "A String", # Detected break type. |
| 383 | }, |
| 384 | "detectedLanguages": [ # A list of detected languages together with confidence. |
| 385 | { # Detected language for a structural component. |
| 386 | "confidence": 3.14, # Confidence of detected language. Range [0, 1]. |
| 387 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
| 388 | }, |
| 389 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 390 | }, |
| 391 | }, |
| 392 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 393 | "confidence": 3.14, # Confidence of the OCR results on the page. Range [0, 1]. |
| 394 | "height": 42, # Page height. For PDFs the unit is points. For images (including TIFFs) the unit is pixels. |
| 395 | "property": { # Additional information detected on the structural component. # Additional information detected on the page. |
| 396 | "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment. |
| 397 | "isPrefix": True or False, # True if break prepends the element. |
| 398 | "type": "A String", # Detected break type. |
| 399 | }, |
| 400 | "detectedLanguages": [ # A list of detected languages together with confidence. |
| 401 | { # Detected language for a structural component. |
| 402 | "confidence": 3.14, # Confidence of detected language. Range [0, 1]. |
| 403 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 404 | }, |
| 405 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 406 | }, |
| 407 | "width": 42, # Page width. For PDFs the unit is points. For images (including TIFFs) the unit is pixels. |
| 408 | }, |
| 409 | ], |
| 410 | "text": "A String", # UTF-8 text detected on the pages. |
| 411 | }, |
| 412 | "imagePropertiesAnnotation": { # Stores image properties, such as dominant colors. # If present, image properties were extracted successfully. |
| 413 | "dominantColors": { # Set of dominant colors and their corresponding scores. # If present, dominant colors completed successfully. |
| 414 | "colors": [ # RGB color values with their score and pixel fraction. |
| 415 | { # Color information consists of RGB channels, score, and the fraction of the image that the color occupies in the image. |
yoshi-code-bot | a8b35b9 | 2021-03-31 13:33:30 -0700 | [diff] [blame] | 416 | "color": { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ... # RGB components of the color. |
| 417 | "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0). |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 418 | "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1]. |
| 419 | "green": 3.14, # The amount of green in the color as a value in the interval [0, 1]. |
| 420 | "red": 3.14, # The amount of red in the color as a value in the interval [0, 1]. |
| 421 | }, |
| 422 | "pixelFraction": 3.14, # The fraction of pixels the color occupies in the image. Value in range [0, 1]. |
| 423 | "score": 3.14, # Image-specific score for this color. Value in range [0, 1]. |
| 424 | }, |
| 425 | ], |
| 426 | }, |
| 427 | }, |
| 428 | "labelAnnotations": [ # If present, label detection has completed successfully. |
| 429 | { # Set of detected entity features. |
| 430 | "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features. |
| 431 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 432 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 433 | "x": 3.14, # X coordinate. |
| 434 | "y": 3.14, # Y coordinate. |
| 435 | }, |
| 436 | ], |
| 437 | "vertices": [ # The bounding polygon vertices. |
| 438 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 439 | "x": 42, # X coordinate. |
| 440 | "y": 42, # Y coordinate. |
| 441 | }, |
| 442 | ], |
| 443 | }, |
| 444 | "confidence": 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. |
| 445 | "description": "A String", # Entity textual description, expressed in its `locale` language. |
| 446 | "locale": "A String", # The language code for the locale in which the entity textual `description` is expressed. |
| 447 | "locations": [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks. |
| 448 | { # Detected entity location information. |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 449 | "latLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 450 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 451 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
| 452 | }, |
| 453 | }, |
| 454 | ], |
| 455 | "mid": "A String", # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). |
| 456 | "properties": [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. |
| 457 | { # A `Property` consists of a user-supplied name/value pair. |
| 458 | "name": "A String", # Name of the property. |
| 459 | "uint64Value": "A String", # Value of numeric properties. |
| 460 | "value": "A String", # Value of the property. |
| 461 | }, |
| 462 | ], |
| 463 | "score": 3.14, # Overall score of the result. Range [0, 1]. |
| 464 | "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of "tower" is likely higher to an image containing the detected "Eiffel Tower" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. |
| 465 | }, |
| 466 | ], |
| 467 | "landmarkAnnotations": [ # If present, landmark detection has completed successfully. |
| 468 | { # Set of detected entity features. |
| 469 | "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features. |
| 470 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 471 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 472 | "x": 3.14, # X coordinate. |
| 473 | "y": 3.14, # Y coordinate. |
| 474 | }, |
| 475 | ], |
| 476 | "vertices": [ # The bounding polygon vertices. |
| 477 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 478 | "x": 42, # X coordinate. |
| 479 | "y": 42, # Y coordinate. |
| 480 | }, |
| 481 | ], |
| 482 | }, |
| 483 | "confidence": 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. |
| 484 | "description": "A String", # Entity textual description, expressed in its `locale` language. |
| 485 | "locale": "A String", # The language code for the locale in which the entity textual `description` is expressed. |
| 486 | "locations": [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks. |
| 487 | { # Detected entity location information. |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 488 | "latLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 489 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 490 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
| 491 | }, |
| 492 | }, |
| 493 | ], |
| 494 | "mid": "A String", # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). |
| 495 | "properties": [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. |
| 496 | { # A `Property` consists of a user-supplied name/value pair. |
| 497 | "name": "A String", # Name of the property. |
| 498 | "uint64Value": "A String", # Value of numeric properties. |
| 499 | "value": "A String", # Value of the property. |
| 500 | }, |
| 501 | ], |
| 502 | "score": 3.14, # Overall score of the result. Range [0, 1]. |
| 503 | "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of "tower" is likely higher to an image containing the detected "Eiffel Tower" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. |
| 504 | }, |
| 505 | ], |
| 506 | "localizedObjectAnnotations": [ # If present, localized object detection has completed successfully. This will be sorted descending by confidence score. |
| 507 | { # Set of detected objects with bounding boxes. |
| 508 | "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this object belongs. This must be populated. |
| 509 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 510 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 511 | "x": 3.14, # X coordinate. |
| 512 | "y": 3.14, # Y coordinate. |
| 513 | }, |
| 514 | ], |
| 515 | "vertices": [ # The bounding polygon vertices. |
| 516 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 517 | "x": 42, # X coordinate. |
| 518 | "y": 42, # Y coordinate. |
| 519 | }, |
| 520 | ], |
| 521 | }, |
| 522 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
| 523 | "mid": "A String", # Object ID that should align with EntityAnnotation mid. |
| 524 | "name": "A String", # Object name, expressed in its `language_code` language. |
| 525 | "score": 3.14, # Score of the result. Range [0, 1]. |
| 526 | }, |
| 527 | ], |
| 528 | "logoAnnotations": [ # If present, logo detection has completed successfully. |
| 529 | { # Set of detected entity features. |
| 530 | "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features. |
| 531 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 532 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 533 | "x": 3.14, # X coordinate. |
| 534 | "y": 3.14, # Y coordinate. |
| 535 | }, |
| 536 | ], |
| 537 | "vertices": [ # The bounding polygon vertices. |
| 538 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 539 | "x": 42, # X coordinate. |
| 540 | "y": 42, # Y coordinate. |
| 541 | }, |
| 542 | ], |
| 543 | }, |
| 544 | "confidence": 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. |
| 545 | "description": "A String", # Entity textual description, expressed in its `locale` language. |
| 546 | "locale": "A String", # The language code for the locale in which the entity textual `description` is expressed. |
| 547 | "locations": [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks. |
| 548 | { # Detected entity location information. |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 549 | "latLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 550 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 551 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
| 552 | }, |
| 553 | }, |
| 554 | ], |
| 555 | "mid": "A String", # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). |
| 556 | "properties": [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. |
| 557 | { # A `Property` consists of a user-supplied name/value pair. |
| 558 | "name": "A String", # Name of the property. |
| 559 | "uint64Value": "A String", # Value of numeric properties. |
| 560 | "value": "A String", # Value of the property. |
| 561 | }, |
| 562 | ], |
| 563 | "score": 3.14, # Overall score of the result. Range [0, 1]. |
| 564 | "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of "tower" is likely higher to an image containing the detected "Eiffel Tower" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. |
| 565 | }, |
| 566 | ], |
| 567 | "productSearchResults": { # Results for a product search request. # If present, product search has completed successfully. |
| 568 | "indexTime": "A String", # Timestamp of the index which provided these results. Products added to the product set and products removed from the product set after this time are not reflected in the current results. |
| 569 | "productGroupedResults": [ # List of results grouped by products detected in the query image. Each entry corresponds to one bounding polygon in the query image, and contains the matching products specific to that region. There may be duplicate product matches in the union of all the per-product results. |
| 570 | { # Information about the products similar to a single product in a query image. |
| 571 | "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the product detected in the query image. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 572 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 573 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 574 | "x": 3.14, # X coordinate. |
| 575 | "y": 3.14, # Y coordinate. |
| 576 | }, |
| 577 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 578 | "vertices": [ # The bounding polygon vertices. |
| 579 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 580 | "x": 42, # X coordinate. |
| 581 | "y": 42, # Y coordinate. |
| 582 | }, |
| 583 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 584 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 585 | "objectAnnotations": [ # List of generic predictions for the object in the bounding box. |
| 586 | { # Prediction for what the object in the bounding box is. |
| 587 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
| 588 | "mid": "A String", # Object ID that should align with EntityAnnotation mid. |
| 589 | "name": "A String", # Object name, expressed in its `language_code` language. |
| 590 | "score": 3.14, # Score of the result. Range [0, 1]. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 591 | }, |
| 592 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 593 | "results": [ # List of results, one for each product match. |
| 594 | { # Information about a product. |
| 595 | "image": "A String", # The resource name of the image from the product that is the closest match to the query. |
| 596 | "product": { # A Product contains ReferenceImages. # The Product. |
| 597 | "description": "A String", # User-provided metadata to be stored with this product. Must be at most 4096 characters long. |
| 598 | "displayName": "A String", # The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long. |
| 599 | "name": "A String", # The resource name of the product. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product. |
| 600 | "productCategory": "A String", # Immutable. The category for the product identified by the reference image. This should be one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products. |
| 601 | "productLabels": [ # Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product may have up to 500 product_labels. Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet. |
| 602 | { # A product label represented as a key-value pair. |
| 603 | "key": "A String", # The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes. |
| 604 | "value": "A String", # The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes. |
| 605 | }, |
| 606 | ], |
| 607 | }, |
| 608 | "score": 3.14, # A confidence level on the match, ranging from 0 (no confidence) to 1 (full confidence). |
| 609 | }, |
| 610 | ], |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 611 | }, |
| 612 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 613 | "results": [ # List of results, one for each product match. |
| 614 | { # Information about a product. |
| 615 | "image": "A String", # The resource name of the image from the product that is the closest match to the query. |
| 616 | "product": { # A Product contains ReferenceImages. # The Product. |
| 617 | "description": "A String", # User-provided metadata to be stored with this product. Must be at most 4096 characters long. |
| 618 | "displayName": "A String", # The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long. |
| 619 | "name": "A String", # The resource name of the product. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product. |
| 620 | "productCategory": "A String", # Immutable. The category for the product identified by the reference image. This should be one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products. |
| 621 | "productLabels": [ # Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels. Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon. Multiple values can be assigned to the same key. One product may have up to 500 product_labels. Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet. |
| 622 | { # A product label represented as a key-value pair. |
| 623 | "key": "A String", # The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes. |
| 624 | "value": "A String", # The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 625 | }, |
| 626 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 627 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 628 | "score": 3.14, # A confidence level on the match, ranging from 0 (no confidence) to 1 (full confidence). |
| 629 | }, |
| 630 | ], |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 631 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 632 | "safeSearchAnnotation": { # Set of features pertaining to the image, computed by computer vision methods over safe-search verticals (for example, adult, spoof, medical, violence). # If present, safe-search annotation has completed successfully. |
| 633 | "adult": "A String", # Represents the adult content likelihood for the image. Adult content may contain elements such as nudity, pornographic images or cartoons, or sexual activities. |
| 634 | "medical": "A String", # Likelihood that this is a medical image. |
| 635 | "racy": "A String", # Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas. |
| 636 | "spoof": "A String", # Spoof likelihood. The likelihood that an modification was made to the image's canonical version to make it appear funny or offensive. |
| 637 | "violence": "A String", # Likelihood that this image contains violent content. |
| 638 | }, |
| 639 | "textAnnotations": [ # If present, text (OCR) detection has completed successfully. |
| 640 | { # Set of detected entity features. |
| 641 | "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features. |
| 642 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 643 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 644 | "x": 3.14, # X coordinate. |
| 645 | "y": 3.14, # Y coordinate. |
| 646 | }, |
| 647 | ], |
| 648 | "vertices": [ # The bounding polygon vertices. |
| 649 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 650 | "x": 42, # X coordinate. |
| 651 | "y": 42, # Y coordinate. |
| 652 | }, |
| 653 | ], |
| 654 | }, |
| 655 | "confidence": 3.14, # **Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. |
| 656 | "description": "A String", # Entity textual description, expressed in its `locale` language. |
| 657 | "locale": "A String", # The language code for the locale in which the entity textual `description` is expressed. |
| 658 | "locations": [ # The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks. |
| 659 | { # Detected entity location information. |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 660 | "latLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # lat/long location coordinates. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 661 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 662 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
| 663 | }, |
| 664 | }, |
| 665 | ], |
| 666 | "mid": "A String", # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). |
| 667 | "properties": [ # Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity. |
| 668 | { # A `Property` consists of a user-supplied name/value pair. |
| 669 | "name": "A String", # Name of the property. |
| 670 | "uint64Value": "A String", # Value of numeric properties. |
| 671 | "value": "A String", # Value of the property. |
| 672 | }, |
| 673 | ], |
| 674 | "score": 3.14, # Overall score of the result. Range [0, 1]. |
| 675 | "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of "tower" is likely higher to an image containing the detected "Eiffel Tower" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. |
| 676 | }, |
| 677 | ], |
| 678 | "webDetection": { # Relevant information for the image from the Internet. # If present, web detection has completed successfully. |
| 679 | "bestGuessLabels": [ # The service's best guess as to the topic of the request image. Inferred from similar images on the open web. |
| 680 | { # Label to provide extra metadata for the web detection. |
| 681 | "label": "A String", # Label for extra metadata. |
| 682 | "languageCode": "A String", # The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. |
| 683 | }, |
| 684 | ], |
| 685 | "fullMatchingImages": [ # Fully matching images from the Internet. Can include resized copies of the query image. |
| 686 | { # Metadata for online images. |
| 687 | "score": 3.14, # (Deprecated) Overall relevancy score for the image. |
| 688 | "url": "A String", # The result image URL. |
| 689 | }, |
| 690 | ], |
| 691 | "pagesWithMatchingImages": [ # Web pages containing the matching images from the Internet. |
| 692 | { # Metadata for web pages. |
| 693 | "fullMatchingImages": [ # Fully matching images on the page. Can include resized copies of the query image. |
| 694 | { # Metadata for online images. |
| 695 | "score": 3.14, # (Deprecated) Overall relevancy score for the image. |
| 696 | "url": "A String", # The result image URL. |
| 697 | }, |
| 698 | ], |
| 699 | "pageTitle": "A String", # Title for the web page, may contain HTML markups. |
| 700 | "partialMatchingImages": [ # Partial matching images on the page. Those images are similar enough to share some key-point features. For example an original image will likely have partial matching for its crops. |
| 701 | { # Metadata for online images. |
| 702 | "score": 3.14, # (Deprecated) Overall relevancy score for the image. |
| 703 | "url": "A String", # The result image URL. |
| 704 | }, |
| 705 | ], |
| 706 | "score": 3.14, # (Deprecated) Overall relevancy score for the web page. |
| 707 | "url": "A String", # The result web page URL. |
| 708 | }, |
| 709 | ], |
| 710 | "partialMatchingImages": [ # Partial matching images from the Internet. Those images are similar enough to share some key-point features. For example an original image will likely have partial matching for its crops. |
| 711 | { # Metadata for online images. |
| 712 | "score": 3.14, # (Deprecated) Overall relevancy score for the image. |
| 713 | "url": "A String", # The result image URL. |
| 714 | }, |
| 715 | ], |
| 716 | "visuallySimilarImages": [ # The visually similar image results. |
| 717 | { # Metadata for online images. |
| 718 | "score": 3.14, # (Deprecated) Overall relevancy score for the image. |
| 719 | "url": "A String", # The result image URL. |
| 720 | }, |
| 721 | ], |
| 722 | "webEntities": [ # Deduced entities from similar images on the Internet. |
| 723 | { # Entity deduced from similar images on the Internet. |
| 724 | "description": "A String", # Canonical description of the entity, in English. |
| 725 | "entityId": "A String", # Opaque entity ID. |
| 726 | "score": 3.14, # Overall relevancy score for the entity. Not normalized and not comparable across different image queries. |
| 727 | }, |
| 728 | ], |
| 729 | }, |
| 730 | }, |
| 731 | ], |
| 732 | }</pre> |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 733 | </div> |
| 734 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 735 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 736 | <code class="details" id="asyncBatchAnnotate">asyncBatchAnnotate(body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 737 | <pre>Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 738 | |
| 739 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 740 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 741 | The object takes the form of: |
| 742 | |
| 743 | { # Request for async image annotation for a list of images. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 744 | "outputConfig": { # The desired output location and metadata. # Required. The desired output location and metadata (e.g. format). |
| 745 | "batchSize": 42, # The max number of response protos to put into each output JSON file on Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response protos will be generated. If `batch_size` = 20, then 5 json files each containing 20 response protos will be written under the prefix `gcs_destination`.`uri`. Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations. |
| 746 | "gcsDestination": { # The Google Cloud Storage location where the output will be written to. # The Google Cloud Storage location to write the output(s) to. |
| 747 | "uri": "A String", # Google Cloud Storage URI prefix where the results will be stored. Results will be in JSON format and preceded by its corresponding input URI prefix. This field can either represent a gcs file prefix or gcs directory. In either case, the uri should be unique because in order to get all of the output files, you will need to do a wildcard gcs search on the uri prefix you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with "filenameprefix". * Directory Prefix: gs://bucket-name/some/location/ The output files will be created in gs://bucket-name/some/location/ and the names of the output files could be anything because there was no filename prefix specified. If multiple outputs, each response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and overflows into multiple sharded files. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 748 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 749 | }, |
| 750 | "parent": "A String", # Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`. |
| 751 | "requests": [ # Required. Individual image annotation requests for this batch. |
| 752 | { # Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information. |
| 753 | "features": [ # Requested features. |
| 754 | { # The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple `Feature` objects can be specified in the `features` list. |
| 755 | "maxResults": 42, # Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. |
| 756 | "model": "A String", # Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest". |
| 757 | "type": "A String", # The feature type. |
| 758 | }, |
| 759 | ], |
| 760 | "image": { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed. |
| 761 | "content": "A String", # Image content, represented as a stream of bytes. Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests. |
| 762 | "source": { # External image source (Google Cloud Storage or web URL image location). # Google Cloud Storage image location, or publicly-accessible image URL. If both `content` and `source` are provided for an image, `content` takes precedence and is used to perform the image annotation request. |
| 763 | "gcsImageUri": "A String", # **Use `image_uri` instead.** The Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. |
| 764 | "imageUri": "A String", # The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from HTTP/HTTPS URLs, Google cannot guarantee that the request will be completed. Your request may fail if the specified host denies the request (e.g. due to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes precedence. |
| 765 | }, |
| 766 | }, |
| 767 | "imageContext": { # Image context and/or feature-specific parameters. # Additional context that may accompany the image. |
| 768 | "cropHintsParams": { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request. |
| 769 | "aspectRatios": [ # Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored. |
| 770 | 3.14, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 771 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 772 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 773 | "languageHints": [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting `language_hints` is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the [supported languages](https://cloud.google.com/vision/docs/languages). |
| 774 | "A String", |
| 775 | ], |
| 776 | "latLongRect": { # Rectangle determined by min and max `LatLng` pairs. # Not used. |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 777 | "maxLatLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # Max lat/long pair. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 778 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 779 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 780 | }, |
yoshi-code-bot | 3fd11cb | 2021-04-28 05:44:03 -0700 | [diff] [blame] | 781 | "minLatLng": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # Min lat/long pair. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 782 | "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0]. |
| 783 | "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0]. |
| 784 | }, |
| 785 | }, |
| 786 | "productSearchParams": { # Parameters for a product search request. # Parameters for product search. |
| 787 | "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied. |
| 788 | "normalizedVertices": [ # The bounding polygon normalized vertices. |
| 789 | { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1. |
| 790 | "x": 3.14, # X coordinate. |
| 791 | "y": 3.14, # Y coordinate. |
| 792 | }, |
| 793 | ], |
| 794 | "vertices": [ # The bounding polygon vertices. |
| 795 | { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image. |
| 796 | "x": 42, # X coordinate. |
| 797 | "y": 42, # Y coordinate. |
| 798 | }, |
| 799 | ], |
| 800 | }, |
| 801 | "filter": "A String", # The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value. For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='. |
| 802 | "productCategories": [ # The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well. |
| 803 | "A String", |
| 804 | ], |
| 805 | "productSet": "A String", # The resource name of a ProductSet to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. |
| 806 | }, |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 807 | "textDetectionParams": { # Parameters for text detections. This is used to control TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features. # Parameters for text detection and document text detection. |
| 808 | "enableTextDetectionConfidenceScore": True or False, # By default, Cloud Vision API only includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence score for TEXT_DETECTION as well. |
| 809 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 810 | "webDetectionParams": { # Parameters for web detection request. # Parameters for web detection. |
| 811 | "includeGeoResults": True or False, # Whether to include results derived from the geo information in the image. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 812 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 813 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 814 | }, |
| 815 | ], |
| 816 | } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 817 | |
| 818 | x__xgafv: string, V1 error format. |
| 819 | Allowed values |
| 820 | 1 - v1 error format |
| 821 | 2 - v2 error format |
| 822 | |
| 823 | Returns: |
| 824 | An object of the form: |
| 825 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 826 | { # This resource represents a long-running operation that is the result of a network API call. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 827 | "done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. |
| 828 | "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation. |
| 829 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 830 | "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use. |
| 831 | { |
| 832 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 833 | }, |
| 834 | ], |
| 835 | "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. |
| 836 | }, |
| 837 | "metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. |
| 838 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 839 | }, |
| 840 | "name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. |
| 841 | "response": { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. |
| 842 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 843 | }, |
| 844 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 845 | </div> |
| 846 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 847 | <div class="method"> |
| 848 | <code class="details" id="close">close()</code> |
| 849 | <pre>Close httplib2 connections.</pre> |
| 850 | </div> |
| 851 | |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 852 | </body></html> |