blob: 4070632f0d630f5d486cbd897c4005790df099cc [file] [log] [blame]
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -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_v1.html">Google Cloud Vision API</a> . <a href="vision_v1.images.html">images</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#annotate">annotate(body, x__xgafv=None)</a></code></p>
79<p class="firstline">Run image detection and annotation for a batch of images.</p>
80<h3>Method Details</h3>
81<div class="method">
82 <code class="details" id="annotate">annotate(body, x__xgafv=None)</code>
83 <pre>Run image detection and annotation for a batch of images.
84
85Args:
86 body: object, The request body. (required)
87 The object takes the form of:
88
89{ # Multiple image annotation requests are batched into a single service call.
90 "requests": [ # Individual image annotation requests for this batch.
91 { # Request for performing Google Cloud Vision API tasks over a user-provided
92 # image, with user-requested features.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080093 "imageContext": { # Image context and/or feature-specific parameters. # Additional context that may accompany the image.
94 "latLongRect": { # Rectangle determined by min and max `LatLng` pairs. # lat/long rectangle that specifies the location of the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070095 "minLatLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # Min lat/long pair.
96 # of doubles representing degrees latitude and degrees longitude. Unless
97 # specified otherwise, this must conform to the
98 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
99 # standard</a>. Values must be within normalized ranges.
100 #
101 # Example of normalization code in Python:
102 #
103 # def NormalizeLongitude(longitude):
104 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
105 # q, r = divmod(longitude, 360.0)
106 # if r > 180.0 or (r == 180.0 and q <= -1.0):
107 # return r - 360.0
108 # return r
109 #
110 # def NormalizeLatLng(latitude, longitude):
111 # """Wraps decimal degrees latitude and longitude to
112 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
113 # r = latitude % 360.0
114 # if r <= 90.0:
115 # return r, NormalizeLongitude(longitude)
116 # elif r >= 270.0:
117 # return r - 360, NormalizeLongitude(longitude)
118 # else:
119 # return 180 - r, NormalizeLongitude(longitude + 180.0)
120 #
121 # assert 180.0 == NormalizeLongitude(180.0)
122 # assert -180.0 == NormalizeLongitude(-180.0)
123 # assert -179.0 == NormalizeLongitude(181.0)
124 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
125 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
126 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
127 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
128 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
129 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
130 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
131 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
132 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
133 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400134 #
135 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
136 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700137 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
138 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
139 },
140 "maxLatLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # Max lat/long pair.
141 # of doubles representing degrees latitude and degrees longitude. Unless
142 # specified otherwise, this must conform to the
143 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
144 # standard</a>. Values must be within normalized ranges.
145 #
146 # Example of normalization code in Python:
147 #
148 # def NormalizeLongitude(longitude):
149 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
150 # q, r = divmod(longitude, 360.0)
151 # if r > 180.0 or (r == 180.0 and q <= -1.0):
152 # return r - 360.0
153 # return r
154 #
155 # def NormalizeLatLng(latitude, longitude):
156 # """Wraps decimal degrees latitude and longitude to
157 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
158 # r = latitude % 360.0
159 # if r <= 90.0:
160 # return r, NormalizeLongitude(longitude)
161 # elif r >= 270.0:
162 # return r - 360, NormalizeLongitude(longitude)
163 # else:
164 # return 180 - r, NormalizeLongitude(longitude + 180.0)
165 #
166 # assert 180.0 == NormalizeLongitude(180.0)
167 # assert -180.0 == NormalizeLongitude(-180.0)
168 # assert -179.0 == NormalizeLongitude(181.0)
169 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
170 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
171 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
172 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
173 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
174 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
175 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
176 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
177 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
178 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400179 #
180 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
181 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700182 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
183 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
184 },
185 },
186 "languageHints": [ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700187 # yields the best results since it enables automatic language detection. For
188 # languages based on the Latin alphabet, setting `language_hints` is not
189 # needed. In rare cases, when the language of the text in the image is known,
190 # setting a hint will help get better results (although it will be a
191 # significant hindrance if the hint is wrong). Text detection returns an
192 # error if one or more of the specified languages is not one of the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800193 # [supported languages](/vision/docs/languages).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700194 "A String",
195 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400196 "cropHintsParams": { # Parameters for crop hints annotation request. # Parameters for crop hints annotation request.
197 "aspectRatios": [ # Aspect ratios in floats, representing the ratio of the width to the height
198 # of the image. For example, if the desired aspect ratio is 4/3, the
199 # corresponding float value should be 1.33333. If not specified, the
200 # best possible crop is returned. The number of provided aspect ratios is
201 # limited to a maximum of 16; any aspect ratios provided after the 16th are
202 # ignored.
203 3.14,
204 ],
205 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700206 },
207 "image": { # Client image to perform Google Cloud Vision API tasks over. # The image to be processed.
208 "content": "A String", # Image content, represented as a stream of bytes.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700209 # Note: as with all `bytes` fields, protobuffers use a pure binary
210 # representation, whereas JSON representations use base64.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800211 "source": { # External image source (Google Cloud Storage image location). # Google Cloud Storage image location. If both `content` and `source`
212 # are provided for an image, `content` takes precedence and is
213 # used to perform the image annotation request.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400214 "gcsImageUri": "A String", # NOTE: For new code `image_uri` below is preferred.
215 # Google Cloud Storage image URI, which must be in the following form:
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800216 # `gs://bucket_name/object_name` (for details, see
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400217 # [Google Cloud Storage Request
218 # URIs](https://cloud.google.com/storage/docs/reference-uris)).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800219 # NOTE: Cloud Storage object versioning is not supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400220 "imageUri": "A String", # Image URI which supports:
221 # 1) Google Cloud Storage image URI, which must be in the following form:
222 # `gs://bucket_name/object_name` (for details, see
223 # [Google Cloud Storage Request
224 # URIs](https://cloud.google.com/storage/docs/reference-uris)).
225 # NOTE: Cloud Storage object versioning is not supported.
226 # 2) Publicly accessible image HTTP/HTTPS URL.
227 # This is preferred over the legacy `gcs_image_uri` above. When both
228 # `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
229 # precedence.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700230 },
231 },
232 "features": [ # Requested features.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800233 { # Users describe the type of Google Cloud Vision API tasks to perform over
234 # images by using *Feature*s. Each Feature indicates a type of image
235 # detection task to perform. Features encode the Cloud Vision API
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700236 # vertical to operate on and the number of top-scoring results to return.
237 "type": "A String", # The feature type.
238 "maxResults": 42, # Maximum number of results of this type.
239 },
240 ],
241 },
242 ],
243 }
244
245 x__xgafv: string, V1 error format.
246 Allowed values
247 1 - v1 error format
248 2 - v2 error format
249
250Returns:
251 An object of the form:
252
253 { # Response to a batch image annotation request.
254 "responses": [ # Individual responses to image annotation requests within the batch.
255 { # Response to an image annotation request.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400256 "safeSearchAnnotation": { # Set of features pertaining to the image, computed by computer vision # If present, safe-search annotation has completed successfully.
257 # methods over safe-search verticals (for example, adult, spoof, medical,
258 # violence).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800259 "medical": "A String", # Likelihood that this is a medical image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800260 "spoof": "A String", # Spoof likelihood. The likelihood that an modification
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700261 # was made to the image's canonical version to make it appear
262 # funny or offensive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400263 "violence": "A String", # Violence likelihood.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800264 "adult": "A String", # Represents the adult content likelihood for the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700265 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800266 "textAnnotations": [ # If present, text (OCR) detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700267 { # Set of detected entity features.
268 "confidence": 3.14, # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800269 # For example, for an image in which the "Eiffel Tower" entity is detected,
270 # this field represents the confidence that there is a tower in the query
271 # image. Range [0, 1].
272 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700273 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800274 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700275 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800276 # image. For example, the relevancy of "tower" is likely higher to an image
277 # containing the detected "Eiffel Tower" than to an image containing a
278 # detected distant towering building, even though the confidence that
279 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700280 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800281 # `LocationInfo` elements can be present because one location may
282 # indicate the location of the scene in the image, and another location
283 # may indicate the location of the place where the image was taken.
284 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700285 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800286 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700287 # of doubles representing degrees latitude and degrees longitude. Unless
288 # specified otherwise, this must conform to the
289 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
290 # standard</a>. Values must be within normalized ranges.
291 #
292 # Example of normalization code in Python:
293 #
294 # def NormalizeLongitude(longitude):
295 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
296 # q, r = divmod(longitude, 360.0)
297 # if r > 180.0 or (r == 180.0 and q <= -1.0):
298 # return r - 360.0
299 # return r
300 #
301 # def NormalizeLatLng(latitude, longitude):
302 # """Wraps decimal degrees latitude and longitude to
303 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
304 # r = latitude % 360.0
305 # if r <= 90.0:
306 # return r, NormalizeLongitude(longitude)
307 # elif r >= 270.0:
308 # return r - 360, NormalizeLongitude(longitude)
309 # else:
310 # return 180 - r, NormalizeLongitude(longitude + 180.0)
311 #
312 # assert 180.0 == NormalizeLongitude(180.0)
313 # assert -180.0 == NormalizeLongitude(-180.0)
314 # assert -179.0 == NormalizeLongitude(181.0)
315 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
316 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
317 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
318 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
319 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
320 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
321 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
322 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
323 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
324 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400325 #
326 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
327 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700328 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
329 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
330 },
331 },
332 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400333 "mid": "A String", # Opaque entity ID. Some IDs may be available in
334 # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700335 "score": 3.14, # Overall score of the result. Range [0, 1].
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800336 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Currently not produced
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700337 # for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s
338 # are produced for the entire text detected in an image region, followed by
339 # `boundingPoly`s for each word within the detected text.
340 "vertices": [ # The bounding polygon vertices.
341 { # A vertex represents a 2D point in the image.
342 # NOTE: the vertex coordinates are in the same scale as the original image.
343 "y": 42, # Y coordinate.
344 "x": 42, # X coordinate.
345 },
346 ],
347 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800348 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
349 # fields, such a score or string that qualifies the entity.
350 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400351 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700352 "name": "A String", # Name of the property.
353 "value": "A String", # Value of the property.
354 },
355 ],
356 },
357 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400358 "webDetection": { # Relevant information for the image from the Internet. # If present, web detection has completed successfully.
359 "pagesWithMatchingImages": [ # Web pages containing the matching images from the Internet.
360 { # Metadata for web pages.
361 "url": "A String", # The result web page URL.
362 "score": 3.14, # Overall relevancy score for the web page.
363 # Not normalized and not comparable across different image queries.
364 },
365 ],
366 "webEntities": [ # Deduced entities from similar images on the Internet.
367 { # Entity deduced from similar images on the Internet.
368 "entityId": "A String", # Opaque entity ID.
369 "score": 3.14, # Overall relevancy score for the entity.
370 # Not normalized and not comparable across different image queries.
371 "description": "A String", # Canonical description of the entity, in English.
372 },
373 ],
374 "partialMatchingImages": [ # Partial matching images from the Internet.
375 # Those images are similar enough to share some key-point features. For
376 # example an original image will likely have partial matching for its crops.
377 { # Metadata for online images.
378 "url": "A String", # The result image URL.
379 "score": 3.14, # Overall relevancy score for the image.
380 # Not normalized and not comparable across different image queries.
381 },
382 ],
383 "fullMatchingImages": [ # Fully matching images from the Internet.
384 # They're definite neardups and most often a copy of the query image with
385 # merely a size change.
386 { # Metadata for online images.
387 "url": "A String", # The result image URL.
388 "score": 3.14, # Overall relevancy score for the image.
389 # Not normalized and not comparable across different image queries.
390 },
391 ],
392 },
393 "error": { # The `Status` type defines a logical error model that is suitable for different # If set, represents the error message for the operation.
394 # Note that filled-in image annotations are guaranteed to be
395 # correct, even when `error` is set.
396 # programming environments, including REST APIs and RPC APIs. It is used by
397 # [gRPC](https://github.com/grpc). The error model is designed to be:
398 #
399 # - Simple to use and understand for most users
400 # - Flexible enough to meet unexpected needs
401 #
402 # # Overview
403 #
404 # The `Status` message contains three pieces of data: error code, error message,
405 # and error details. The error code should be an enum value of
406 # google.rpc.Code, but it may accept additional error codes if needed. The
407 # error message should be a developer-facing English message that helps
408 # developers *understand* and *resolve* the error. If a localized user-facing
409 # error message is needed, put the localized message in the error details or
410 # localize it in the client. The optional error details may contain arbitrary
411 # information about the error. There is a predefined set of error detail types
412 # in the package `google.rpc` which can be used for common error conditions.
413 #
414 # # Language mapping
415 #
416 # The `Status` message is the logical representation of the error model, but it
417 # is not necessarily the actual wire format. When the `Status` message is
418 # exposed in different client libraries and different wire protocols, it can be
419 # mapped differently. For example, it will likely be mapped to some exceptions
420 # in Java, but more likely mapped to some error codes in C.
421 #
422 # # Other uses
423 #
424 # The error model and the `Status` message can be used in a variety of
425 # environments, either with or without APIs, to provide a
426 # consistent developer experience across different environments.
427 #
428 # Example uses of this error model include:
429 #
430 # - Partial errors. If a service needs to return partial errors to the client,
431 # it may embed the `Status` in the normal response to indicate the partial
432 # errors.
433 #
434 # - Workflow errors. A typical workflow has multiple steps. Each step may
435 # have a `Status` message for error reporting purpose.
436 #
437 # - Batch operations. If a client uses batch request and batch response, the
438 # `Status` message should be used directly inside batch response, one for
439 # each error sub-response.
440 #
441 # - Asynchronous operations. If an API call embeds asynchronous operation
442 # results in its response, the status of those operations should be
443 # represented directly using the `Status` message.
444 #
445 # - Logging. If some API errors are stored in logs, the message `Status` could
446 # be used directly after any stripping needed for security/privacy reasons.
447 "message": "A String", # A developer-facing error message, which should be in English. Any
448 # user-facing error message should be localized and sent in the
449 # google.rpc.Status.details field, or localized by the client.
450 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
451 "details": [ # A list of messages that carry the error details. There will be a
452 # common set of message types for APIs to use.
453 {
454 "a_key": "", # Properties of the object. Contains field @type with type URL.
455 },
456 ],
457 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800458 "labelAnnotations": [ # If present, label detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700459 { # Set of detected entity features.
460 "confidence": 3.14, # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800461 # For example, for an image in which the "Eiffel Tower" entity is detected,
462 # this field represents the confidence that there is a tower in the query
463 # image. Range [0, 1].
464 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700465 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800466 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700467 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800468 # image. For example, the relevancy of "tower" is likely higher to an image
469 # containing the detected "Eiffel Tower" than to an image containing a
470 # detected distant towering building, even though the confidence that
471 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700472 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800473 # `LocationInfo` elements can be present because one location may
474 # indicate the location of the scene in the image, and another location
475 # may indicate the location of the place where the image was taken.
476 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700477 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800478 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700479 # of doubles representing degrees latitude and degrees longitude. Unless
480 # specified otherwise, this must conform to the
481 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
482 # standard</a>. Values must be within normalized ranges.
483 #
484 # Example of normalization code in Python:
485 #
486 # def NormalizeLongitude(longitude):
487 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
488 # q, r = divmod(longitude, 360.0)
489 # if r > 180.0 or (r == 180.0 and q <= -1.0):
490 # return r - 360.0
491 # return r
492 #
493 # def NormalizeLatLng(latitude, longitude):
494 # """Wraps decimal degrees latitude and longitude to
495 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
496 # r = latitude % 360.0
497 # if r <= 90.0:
498 # return r, NormalizeLongitude(longitude)
499 # elif r >= 270.0:
500 # return r - 360, NormalizeLongitude(longitude)
501 # else:
502 # return 180 - r, NormalizeLongitude(longitude + 180.0)
503 #
504 # assert 180.0 == NormalizeLongitude(180.0)
505 # assert -180.0 == NormalizeLongitude(-180.0)
506 # assert -179.0 == NormalizeLongitude(181.0)
507 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
508 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
509 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
510 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
511 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
512 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
513 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
514 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
515 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
516 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400517 #
518 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
519 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700520 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
521 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
522 },
523 },
524 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400525 "mid": "A String", # Opaque entity ID. Some IDs may be available in
526 # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700527 "score": 3.14, # Overall score of the result. Range [0, 1].
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800528 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Currently not produced
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700529 # for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s
530 # are produced for the entire text detected in an image region, followed by
531 # `boundingPoly`s for each word within the detected text.
532 "vertices": [ # The bounding polygon vertices.
533 { # A vertex represents a 2D point in the image.
534 # NOTE: the vertex coordinates are in the same scale as the original image.
535 "y": 42, # Y coordinate.
536 "x": 42, # X coordinate.
537 },
538 ],
539 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800540 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
541 # fields, such a score or string that qualifies the entity.
542 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400543 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700544 "name": "A String", # Name of the property.
545 "value": "A String", # Value of the property.
546 },
547 ],
548 },
549 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800550 "imagePropertiesAnnotation": { # Stores image properties, such as dominant colors. # If present, image properties were extracted successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700551 "dominantColors": { # Set of dominant colors and their corresponding scores. # If present, dominant colors completed successfully.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800552 "colors": [ # RGB color values with their score and pixel fraction.
553 { # Color information consists of RGB channels, score, and the fraction of
554 # the image that the color occupies in the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700555 "color": { # Represents a color in the RGBA color space. This representation is designed # RGB components of the color.
556 # for simplicity of conversion to/from color representations in various
557 # languages over compactness; for example, the fields of this representation
558 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
559 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
560 # method in iOS; and, with just a little work, it can be easily formatted into
561 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
562 #
563 # Example (Java):
564 #
565 # import com.google.type.Color;
566 #
567 # // ...
568 # public static java.awt.Color fromProto(Color protocolor) {
569 # float alpha = protocolor.hasAlpha()
570 # ? protocolor.getAlpha().getValue()
571 # : 1.0;
572 #
573 # return new java.awt.Color(
574 # protocolor.getRed(),
575 # protocolor.getGreen(),
576 # protocolor.getBlue(),
577 # alpha);
578 # }
579 #
580 # public static Color toProto(java.awt.Color color) {
581 # float red = (float) color.getRed();
582 # float green = (float) color.getGreen();
583 # float blue = (float) color.getBlue();
584 # float denominator = 255.0;
585 # Color.Builder resultBuilder =
586 # Color
587 # .newBuilder()
588 # .setRed(red / denominator)
589 # .setGreen(green / denominator)
590 # .setBlue(blue / denominator);
591 # int alpha = color.getAlpha();
592 # if (alpha != 255) {
593 # result.setAlpha(
594 # FloatValue
595 # .newBuilder()
596 # .setValue(((float) alpha) / denominator)
597 # .build());
598 # }
599 # return resultBuilder.build();
600 # }
601 # // ...
602 #
603 # Example (iOS / Obj-C):
604 #
605 # // ...
606 # static UIColor* fromProto(Color* protocolor) {
607 # float red = [protocolor red];
608 # float green = [protocolor green];
609 # float blue = [protocolor blue];
610 # FloatValue* alpha_wrapper = [protocolor alpha];
611 # float alpha = 1.0;
612 # if (alpha_wrapper != nil) {
613 # alpha = [alpha_wrapper value];
614 # }
615 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
616 # }
617 #
618 # static Color* toProto(UIColor* color) {
619 # CGFloat red, green, blue, alpha;
620 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
621 # return nil;
622 # }
623 # Color* result = [Color alloc] init];
624 # [result setRed:red];
625 # [result setGreen:green];
626 # [result setBlue:blue];
627 # if (alpha <= 0.9999) {
628 # [result setAlpha:floatWrapperWithValue(alpha)];
629 # }
630 # [result autorelease];
631 # return result;
632 # }
633 # // ...
634 #
635 # Example (JavaScript):
636 #
637 # // ...
638 #
639 # var protoToCssColor = function(rgb_color) {
640 # var redFrac = rgb_color.red || 0.0;
641 # var greenFrac = rgb_color.green || 0.0;
642 # var blueFrac = rgb_color.blue || 0.0;
643 # var red = Math.floor(redFrac * 255);
644 # var green = Math.floor(greenFrac * 255);
645 # var blue = Math.floor(blueFrac * 255);
646 #
647 # if (!('alpha' in rgb_color)) {
648 # return rgbToCssColor_(red, green, blue);
649 # }
650 #
651 # var alphaFrac = rgb_color.alpha.value || 0.0;
652 # var rgbParams = [red, green, blue].join(',');
653 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
654 # };
655 #
656 # var rgbToCssColor_ = function(red, green, blue) {
657 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
658 # var hexString = rgbNumber.toString(16);
659 # var missingZeros = 6 - hexString.length;
660 # var resultBuilder = ['#'];
661 # for (var i = 0; i < missingZeros; i++) {
662 # resultBuilder.push('0');
663 # }
664 # resultBuilder.push(hexString);
665 # return resultBuilder.join('');
666 # };
667 #
668 # // ...
669 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
670 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
671 # the final pixel color is defined by the equation:
672 #
673 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
674 #
675 # This means that a value of 1.0 corresponds to a solid color, whereas
676 # a value of 0.0 corresponds to a completely transparent color. This
677 # uses a wrapper message rather than a simple float scalar so that it is
678 # possible to distinguish between a default value and the value being unset.
679 # If omitted, this color object is to be rendered as a solid color
680 # (as if the alpha value had been explicitly given with a value of 1.0).
681 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
682 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
683 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800684 "pixelFraction": 3.14, # The fraction of pixels the color occupies in the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700685 # Value in range [0, 1].
686 "score": 3.14, # Image-specific score for this color. Value in range [0, 1].
687 },
688 ],
689 },
690 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800691 "faceAnnotations": [ # If present, face detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700692 { # A face annotation object contains the results of face detection.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800693 "panAngle": 3.14, # Yaw angle, which indicates the leftward/rightward angle that the face is
694 # pointing relative to the vertical plane perpendicular to the image. Range
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700695 # [-180,180].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700696 "underExposedLikelihood": "A String", # Under-exposed likelihood.
697 "detectionConfidence": 3.14, # Detection confidence. Range [0, 1].
698 "joyLikelihood": "A String", # Joy likelihood.
699 "landmarks": [ # Detected face landmarks.
700 { # A face-specific landmark (for example, a face feature).
701 # Landmark positions may fall outside the bounds of the image
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800702 # if the face is near one or more edges of the image.
703 # Therefore it is NOT guaranteed that `0 <= x < width` or
704 # `0 <= y < height`.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700705 "position": { # A 3D position in the image, used primarily for Face detection landmarks. # Face landmark position.
706 # A valid Position must have both x and y coordinates.
707 # The position coordinates are in the same scale as the original image.
708 "y": 3.14, # Y coordinate.
709 "x": 3.14, # X coordinate.
710 "z": 3.14, # Z coordinate (or depth).
711 },
712 "type": "A String", # Face landmark type.
713 },
714 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400715 "sorrowLikelihood": "A String", # Sorrow likelihood.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700716 "blurredLikelihood": "A String", # Blurred likelihood.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800717 "tiltAngle": 3.14, # Pitch angle, which indicates the upwards/downwards angle that the face is
718 # pointing relative to the image's horizontal plane. Range [-180,180].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700719 "angerLikelihood": "A String", # Anger likelihood.
720 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon around the face. The coordinates of the bounding box
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800721 # are in the original image's scale, as returned in `ImageParams`.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700722 # The bounding box is computed to "frame" the face in accordance with human
723 # expectations. It is based on the landmarker results.
724 # Note that one or more x and/or y coordinates may not be generated in the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800725 # `BoundingPoly` (the polygon will be unbounded) if only a partial face
726 # appears in the image to be annotated.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700727 "vertices": [ # The bounding polygon vertices.
728 { # A vertex represents a 2D point in the image.
729 # NOTE: the vertex coordinates are in the same scale as the original image.
730 "y": 42, # Y coordinate.
731 "x": 42, # X coordinate.
732 },
733 ],
734 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800735 "rollAngle": 3.14, # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
736 # of the face relative to the image vertical about the axis perpendicular to
737 # the face. Range [-180,180].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700738 "headwearLikelihood": "A String", # Headwear likelihood.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400739 "surpriseLikelihood": "A String", # Surprise likelihood.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800740 "fdBoundingPoly": { # A bounding polygon for the detected image annotation. # The `fd_bounding_poly` bounding polygon is tighter than the
741 # `boundingPoly`, and encloses only the skin part of the face. Typically, it
742 # is used to eliminate the face from any image analysis that detects the
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700743 # "amount of skin" visible in an image. It is not based on the
744 # landmarker results, only on the initial face detection, hence
745 # the <code>fd</code> (face detection) prefix.
746 "vertices": [ # The bounding polygon vertices.
747 { # A vertex represents a 2D point in the image.
748 # NOTE: the vertex coordinates are in the same scale as the original image.
749 "y": 42, # Y coordinate.
750 "x": 42, # X coordinate.
751 },
752 ],
753 },
754 "landmarkingConfidence": 3.14, # Face landmarking confidence. Range [0, 1].
755 },
756 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800757 "logoAnnotations": [ # If present, logo detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700758 { # Set of detected entity features.
759 "confidence": 3.14, # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800760 # For example, for an image in which the "Eiffel Tower" entity is detected,
761 # this field represents the confidence that there is a tower in the query
762 # image. Range [0, 1].
763 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700764 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800765 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700766 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800767 # image. For example, the relevancy of "tower" is likely higher to an image
768 # containing the detected "Eiffel Tower" than to an image containing a
769 # detected distant towering building, even though the confidence that
770 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700771 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800772 # `LocationInfo` elements can be present because one location may
773 # indicate the location of the scene in the image, and another location
774 # may indicate the location of the place where the image was taken.
775 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700776 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800777 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700778 # of doubles representing degrees latitude and degrees longitude. Unless
779 # specified otherwise, this must conform to the
780 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
781 # standard</a>. Values must be within normalized ranges.
782 #
783 # Example of normalization code in Python:
784 #
785 # def NormalizeLongitude(longitude):
786 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
787 # q, r = divmod(longitude, 360.0)
788 # if r > 180.0 or (r == 180.0 and q <= -1.0):
789 # return r - 360.0
790 # return r
791 #
792 # def NormalizeLatLng(latitude, longitude):
793 # """Wraps decimal degrees latitude and longitude to
794 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
795 # r = latitude % 360.0
796 # if r <= 90.0:
797 # return r, NormalizeLongitude(longitude)
798 # elif r >= 270.0:
799 # return r - 360, NormalizeLongitude(longitude)
800 # else:
801 # return 180 - r, NormalizeLongitude(longitude + 180.0)
802 #
803 # assert 180.0 == NormalizeLongitude(180.0)
804 # assert -180.0 == NormalizeLongitude(-180.0)
805 # assert -179.0 == NormalizeLongitude(181.0)
806 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
807 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
808 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
809 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
810 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
811 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
812 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
813 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
814 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
815 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400816 #
817 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
818 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700819 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
820 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
821 },
822 },
823 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400824 "mid": "A String", # Opaque entity ID. Some IDs may be available in
825 # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700826 "score": 3.14, # Overall score of the result. Range [0, 1].
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800827 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Currently not produced
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700828 # for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s
829 # are produced for the entire text detected in an image region, followed by
830 # `boundingPoly`s for each word within the detected text.
831 "vertices": [ # The bounding polygon vertices.
832 { # A vertex represents a 2D point in the image.
833 # NOTE: the vertex coordinates are in the same scale as the original image.
834 "y": 42, # Y coordinate.
835 "x": 42, # X coordinate.
836 },
837 ],
838 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800839 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
840 # fields, such a score or string that qualifies the entity.
841 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400842 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700843 "name": "A String", # Name of the property.
844 "value": "A String", # Value of the property.
845 },
846 ],
847 },
848 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800849 "landmarkAnnotations": [ # If present, landmark detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700850 { # Set of detected entity features.
851 "confidence": 3.14, # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800852 # For example, for an image in which the "Eiffel Tower" entity is detected,
853 # this field represents the confidence that there is a tower in the query
854 # image. Range [0, 1].
855 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700856 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800857 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700858 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800859 # image. For example, the relevancy of "tower" is likely higher to an image
860 # containing the detected "Eiffel Tower" than to an image containing a
861 # detected distant towering building, even though the confidence that
862 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700863 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800864 # `LocationInfo` elements can be present because one location may
865 # indicate the location of the scene in the image, and another location
866 # may indicate the location of the place where the image was taken.
867 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700868 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800869 "latLng": { # An object representing a latitude/longitude pair. This is expressed as a pair # lat/long location coordinates.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700870 # of doubles representing degrees latitude and degrees longitude. Unless
871 # specified otherwise, this must conform to the
872 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
873 # standard</a>. Values must be within normalized ranges.
874 #
875 # Example of normalization code in Python:
876 #
877 # def NormalizeLongitude(longitude):
878 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
879 # q, r = divmod(longitude, 360.0)
880 # if r > 180.0 or (r == 180.0 and q <= -1.0):
881 # return r - 360.0
882 # return r
883 #
884 # def NormalizeLatLng(latitude, longitude):
885 # """Wraps decimal degrees latitude and longitude to
886 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
887 # r = latitude % 360.0
888 # if r <= 90.0:
889 # return r, NormalizeLongitude(longitude)
890 # elif r >= 270.0:
891 # return r - 360, NormalizeLongitude(longitude)
892 # else:
893 # return 180 - r, NormalizeLongitude(longitude + 180.0)
894 #
895 # assert 180.0 == NormalizeLongitude(180.0)
896 # assert -180.0 == NormalizeLongitude(-180.0)
897 # assert -179.0 == NormalizeLongitude(181.0)
898 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
899 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
900 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
901 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
902 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
903 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
904 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
905 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
906 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
907 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400908 #
909 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
910 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700911 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
912 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
913 },
914 },
915 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400916 "mid": "A String", # Opaque entity ID. Some IDs may be available in
917 # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700918 "score": 3.14, # Overall score of the result. Range [0, 1].
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800919 "boundingPoly": { # A bounding polygon for the detected image annotation. # Image region to which this entity belongs. Currently not produced
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700920 # for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s
921 # are produced for the entire text detected in an image region, followed by
922 # `boundingPoly`s for each word within the detected text.
923 "vertices": [ # The bounding polygon vertices.
924 { # A vertex represents a 2D point in the image.
925 # NOTE: the vertex coordinates are in the same scale as the original image.
926 "y": 42, # Y coordinate.
927 "x": 42, # X coordinate.
928 },
929 ],
930 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800931 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
932 # fields, such a score or string that qualifies the entity.
933 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400934 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700935 "name": "A String", # Name of the property.
936 "value": "A String", # Value of the property.
937 },
938 ],
939 },
940 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400941 "fullTextAnnotation": { # TextAnnotation contains a structured representation of OCR extracted text. # If present, text (OCR) detection or document (OCR) text detection has
942 # completed successfully.
943 # This annotation provides the structural hierarchy for the OCR detected
944 # text.
945 # The hierarchy of an OCR extracted text structure is like this:
946 # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
947 # Each structural component, starting from Page, may further have their own
948 # properties. Properties describe detected languages, breaks etc.. Please
949 # refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
950 # definition below for more detail.
951 "text": "A String", # UTF-8 text detected on the pages.
952 "pages": [ # List of pages detected by OCR.
953 { # Detected page from OCR.
954 "width": 42, # Page width in pixels.
955 "property": { # Additional information detected on the structural component. # Additional information detected on the page.
956 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
957 "isPrefix": True or False, # True if break prepends the element.
958 "type": "A String", # Detected break type.
959 },
960 "detectedLanguages": [ # A list of detected languages together with confidence.
961 { # Detected language for a structural component.
962 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
963 # information, see
964 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
965 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
966 },
967 ],
968 },
969 "blocks": [ # List of blocks of text, images etc on this page.
970 { # Logical element on the page.
971 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the block.
972 # The vertices are in the order of top-left, top-right, bottom-right,
973 # bottom-left. When a rotation of the bounding box is detected the rotation
974 # is represented as around the top-left corner as defined when the text is
975 # read in the 'natural' orientation.
976 # For example:
977 # * when the text is horizontal it might look like:
978 # 0----1
979 # | |
980 # 3----2
981 # * when it's rotated 180 degrees around the top-left corner it becomes:
982 # 2----3
983 # | |
984 # 1----0
985 # and the vertice order will still be (0, 1, 2, 3).
986 "vertices": [ # The bounding polygon vertices.
987 { # A vertex represents a 2D point in the image.
988 # NOTE: the vertex coordinates are in the same scale as the original image.
989 "y": 42, # Y coordinate.
990 "x": 42, # X coordinate.
991 },
992 ],
993 },
994 "blockType": "A String", # Detected block type (text, image etc) for this block.
995 "property": { # Additional information detected on the structural component. # Additional information detected for the block.
996 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
997 "isPrefix": True or False, # True if break prepends the element.
998 "type": "A String", # Detected break type.
999 },
1000 "detectedLanguages": [ # A list of detected languages together with confidence.
1001 { # Detected language for a structural component.
1002 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
1003 # information, see
1004 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1005 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
1006 },
1007 ],
1008 },
1009 "paragraphs": [ # List of paragraphs in this block (if this blocks is of type text).
1010 { # Structural unit of text representing a number of words in certain order.
1011 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the paragraph.
1012 # The vertices are in the order of top-left, top-right, bottom-right,
1013 # bottom-left. When a rotation of the bounding box is detected the rotation
1014 # is represented as around the top-left corner as defined when the text is
1015 # read in the 'natural' orientation.
1016 # For example:
1017 # * when the text is horizontal it might look like:
1018 # 0----1
1019 # | |
1020 # 3----2
1021 # * when it's rotated 180 degrees around the top-left corner it becomes:
1022 # 2----3
1023 # | |
1024 # 1----0
1025 # and the vertice order will still be (0, 1, 2, 3).
1026 "vertices": [ # The bounding polygon vertices.
1027 { # A vertex represents a 2D point in the image.
1028 # NOTE: the vertex coordinates are in the same scale as the original image.
1029 "y": 42, # Y coordinate.
1030 "x": 42, # X coordinate.
1031 },
1032 ],
1033 },
1034 "property": { # Additional information detected on the structural component. # Additional information detected for the paragraph.
1035 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
1036 "isPrefix": True or False, # True if break prepends the element.
1037 "type": "A String", # Detected break type.
1038 },
1039 "detectedLanguages": [ # A list of detected languages together with confidence.
1040 { # Detected language for a structural component.
1041 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
1042 # information, see
1043 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1044 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
1045 },
1046 ],
1047 },
1048 "words": [ # List of words in this paragraph.
1049 { # A word representation.
1050 "symbols": [ # List of symbols in the word.
1051 # The order of the symbols follows the natural reading order.
1052 { # A single symbol representation.
1053 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the symbol.
1054 # The vertices are in the order of top-left, top-right, bottom-right,
1055 # bottom-left. When a rotation of the bounding box is detected the rotation
1056 # is represented as around the top-left corner as defined when the text is
1057 # read in the 'natural' orientation.
1058 # For example:
1059 # * when the text is horizontal it might look like:
1060 # 0----1
1061 # | |
1062 # 3----2
1063 # * when it's rotated 180 degrees around the top-left corner it becomes:
1064 # 2----3
1065 # | |
1066 # 1----0
1067 # and the vertice order will still be (0, 1, 2, 3).
1068 "vertices": [ # The bounding polygon vertices.
1069 { # A vertex represents a 2D point in the image.
1070 # NOTE: the vertex coordinates are in the same scale as the original image.
1071 "y": 42, # Y coordinate.
1072 "x": 42, # X coordinate.
1073 },
1074 ],
1075 },
1076 "text": "A String", # The actual UTF-8 representation of the symbol.
1077 "property": { # Additional information detected on the structural component. # Additional information detected for the symbol.
1078 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
1079 "isPrefix": True or False, # True if break prepends the element.
1080 "type": "A String", # Detected break type.
1081 },
1082 "detectedLanguages": [ # A list of detected languages together with confidence.
1083 { # Detected language for a structural component.
1084 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
1085 # information, see
1086 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1087 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
1088 },
1089 ],
1090 },
1091 },
1092 ],
1093 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the word.
1094 # The vertices are in the order of top-left, top-right, bottom-right,
1095 # bottom-left. When a rotation of the bounding box is detected the rotation
1096 # is represented as around the top-left corner as defined when the text is
1097 # read in the 'natural' orientation.
1098 # For example:
1099 # * when the text is horizontal it might look like:
1100 # 0----1
1101 # | |
1102 # 3----2
1103 # * when it's rotated 180 degrees around the top-left corner it becomes:
1104 # 2----3
1105 # | |
1106 # 1----0
1107 # and the vertice order will still be (0, 1, 2, 3).
1108 "vertices": [ # The bounding polygon vertices.
1109 { # A vertex represents a 2D point in the image.
1110 # NOTE: the vertex coordinates are in the same scale as the original image.
1111 "y": 42, # Y coordinate.
1112 "x": 42, # X coordinate.
1113 },
1114 ],
1115 },
1116 "property": { # Additional information detected on the structural component. # Additional information detected for the word.
1117 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
1118 "isPrefix": True or False, # True if break prepends the element.
1119 "type": "A String", # Detected break type.
1120 },
1121 "detectedLanguages": [ # A list of detected languages together with confidence.
1122 { # Detected language for a structural component.
1123 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
1124 # information, see
1125 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1126 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
1127 },
1128 ],
1129 },
1130 },
1131 ],
1132 },
1133 ],
1134 },
1135 ],
1136 "height": 42, # Page height in pixels.
1137 },
1138 ],
1139 },
1140 "cropHintsAnnotation": { # Set of crop hints that are used to generate new crops when serving images. # If present, crop hints have completed successfully.
1141 "cropHints": [ # Crop hint results.
1142 { # Single crop hint that is used to generate a new crop when serving an image.
1143 "confidence": 3.14, # Confidence of this being a salient region. Range [0, 1].
1144 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon for the crop region. The coordinates of the bounding
1145 # box are in the original image's scale, as returned in `ImageParams`.
1146 "vertices": [ # The bounding polygon vertices.
1147 { # A vertex represents a 2D point in the image.
1148 # NOTE: the vertex coordinates are in the same scale as the original image.
1149 "y": 42, # Y coordinate.
1150 "x": 42, # X coordinate.
1151 },
1152 ],
1153 },
1154 "importanceFraction": 3.14, # Fraction of importance of this salient region with respect to the original
1155 # image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001156 },
1157 ],
1158 },
1159 },
1160 ],
1161 }</pre>
1162</div>
1163
1164</body></html>