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