blob: 9471feb095f597903e358f38bbbe9ac4c9d9c8cf [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.
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700260 "violence": "A String", # Violence likelihood.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800261 "spoof": "A String", # Spoof likelihood. The likelihood that an modification
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700262 # was made to the image's canonical version to make it appear
263 # funny or offensive.
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.
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700359 "webEntities": [ # Deduced entities from similar images on the Internet.
360 { # Entity deduced from similar images on the Internet.
361 "entityId": "A String", # Opaque entity ID.
362 "score": 3.14, # Overall relevancy score for the entity.
363 # Not normalized and not comparable across different image queries.
364 "description": "A String", # Canonical description of the entity, in English.
365 },
366 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400367 "pagesWithMatchingImages": [ # Web pages containing the matching images from the Internet.
368 { # Metadata for web pages.
369 "url": "A String", # The result web page URL.
370 "score": 3.14, # Overall relevancy score for the web page.
371 # Not normalized and not comparable across different image queries.
372 },
373 ],
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700374 "visuallySimilarImages": [ # The visually similar image results.
375 { # Metadata for online images.
376 "url": "A String", # The result image URL.
377 "score": 3.14, # Overall relevancy score for the image.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400378 # Not normalized and not comparable across different image queries.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400379 },
380 ],
381 "partialMatchingImages": [ # Partial matching images from the Internet.
382 # Those images are similar enough to share some key-point features. For
383 # example an original image will likely have partial matching for its crops.
384 { # Metadata for online images.
385 "url": "A String", # The result image URL.
386 "score": 3.14, # Overall relevancy score for the image.
387 # Not normalized and not comparable across different image queries.
388 },
389 ],
390 "fullMatchingImages": [ # Fully matching images from the Internet.
391 # They're definite neardups and most often a copy of the query image with
392 # merely a size change.
393 { # Metadata for online images.
394 "url": "A String", # The result image URL.
395 "score": 3.14, # Overall relevancy score for the image.
396 # Not normalized and not comparable across different image queries.
397 },
398 ],
399 },
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700400 "fullTextAnnotation": { # TextAnnotation contains a structured representation of OCR extracted text. # If present, text (OCR) detection or document (OCR) text detection has
401 # completed successfully.
402 # This annotation provides the structural hierarchy for the OCR detected
403 # text.
404 # The hierarchy of an OCR extracted text structure is like this:
405 # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
406 # Each structural component, starting from Page, may further have their own
407 # properties. Properties describe detected languages, breaks etc.. Please
408 # refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
409 # definition below for more detail.
410 "text": "A String", # UTF-8 text detected on the pages.
411 "pages": [ # List of pages detected by OCR.
412 { # Detected page from OCR.
413 "width": 42, # Page width in pixels.
414 "property": { # Additional information detected on the structural component. # Additional information detected on the page.
415 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
416 "isPrefix": True or False, # True if break prepends the element.
417 "type": "A String", # Detected break type.
418 },
419 "detectedLanguages": [ # A list of detected languages together with confidence.
420 { # Detected language for a structural component.
421 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
422 # information, see
423 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
424 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
425 },
426 ],
427 },
428 "blocks": [ # List of blocks of text, images etc on this page.
429 { # Logical element on the page.
430 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the block.
431 # The vertices are in the order of top-left, top-right, bottom-right,
432 # bottom-left. When a rotation of the bounding box is detected the rotation
433 # is represented as around the top-left corner as defined when the text is
434 # read in the 'natural' orientation.
435 # For example:
436 # * when the text is horizontal it might look like:
437 # 0----1
438 # | |
439 # 3----2
440 # * when it's rotated 180 degrees around the top-left corner it becomes:
441 # 2----3
442 # | |
443 # 1----0
444 # and the vertice order will still be (0, 1, 2, 3).
445 "vertices": [ # The bounding polygon vertices.
446 { # A vertex represents a 2D point in the image.
447 # NOTE: the vertex coordinates are in the same scale as the original image.
448 "y": 42, # Y coordinate.
449 "x": 42, # X coordinate.
450 },
451 ],
452 },
453 "blockType": "A String", # Detected block type (text, image etc) for this block.
454 "property": { # Additional information detected on the structural component. # Additional information detected for the block.
455 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
456 "isPrefix": True or False, # True if break prepends the element.
457 "type": "A String", # Detected break type.
458 },
459 "detectedLanguages": [ # A list of detected languages together with confidence.
460 { # Detected language for a structural component.
461 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
462 # information, see
463 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
464 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
465 },
466 ],
467 },
468 "paragraphs": [ # List of paragraphs in this block (if this blocks is of type text).
469 { # Structural unit of text representing a number of words in certain order.
470 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the paragraph.
471 # The vertices are in the order of top-left, top-right, bottom-right,
472 # bottom-left. When a rotation of the bounding box is detected the rotation
473 # is represented as around the top-left corner as defined when the text is
474 # read in the 'natural' orientation.
475 # For example:
476 # * when the text is horizontal it might look like:
477 # 0----1
478 # | |
479 # 3----2
480 # * when it's rotated 180 degrees around the top-left corner it becomes:
481 # 2----3
482 # | |
483 # 1----0
484 # and the vertice order will still be (0, 1, 2, 3).
485 "vertices": [ # The bounding polygon vertices.
486 { # A vertex represents a 2D point in the image.
487 # NOTE: the vertex coordinates are in the same scale as the original image.
488 "y": 42, # Y coordinate.
489 "x": 42, # X coordinate.
490 },
491 ],
492 },
493 "property": { # Additional information detected on the structural component. # Additional information detected for the paragraph.
494 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
495 "isPrefix": True or False, # True if break prepends the element.
496 "type": "A String", # Detected break type.
497 },
498 "detectedLanguages": [ # A list of detected languages together with confidence.
499 { # Detected language for a structural component.
500 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
501 # information, see
502 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
503 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
504 },
505 ],
506 },
507 "words": [ # List of words in this paragraph.
508 { # A word representation.
509 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the word.
510 # The vertices are in the order of top-left, top-right, bottom-right,
511 # bottom-left. When a rotation of the bounding box is detected the rotation
512 # is represented as around the top-left corner as defined when the text is
513 # read in the 'natural' orientation.
514 # For example:
515 # * when the text is horizontal it might look like:
516 # 0----1
517 # | |
518 # 3----2
519 # * when it's rotated 180 degrees around the top-left corner it becomes:
520 # 2----3
521 # | |
522 # 1----0
523 # and the vertice order will still be (0, 1, 2, 3).
524 "vertices": [ # The bounding polygon vertices.
525 { # A vertex represents a 2D point in the image.
526 # NOTE: the vertex coordinates are in the same scale as the original image.
527 "y": 42, # Y coordinate.
528 "x": 42, # X coordinate.
529 },
530 ],
531 },
532 "symbols": [ # List of symbols in the word.
533 # The order of the symbols follows the natural reading order.
534 { # A single symbol representation.
535 "boundingBox": { # A bounding polygon for the detected image annotation. # The bounding box for the symbol.
536 # The vertices are in the order of top-left, top-right, bottom-right,
537 # bottom-left. When a rotation of the bounding box is detected the rotation
538 # is represented as around the top-left corner as defined when the text is
539 # read in the 'natural' orientation.
540 # For example:
541 # * when the text is horizontal it might look like:
542 # 0----1
543 # | |
544 # 3----2
545 # * when it's rotated 180 degrees around the top-left corner it becomes:
546 # 2----3
547 # | |
548 # 1----0
549 # and the vertice order will still be (0, 1, 2, 3).
550 "vertices": [ # The bounding polygon vertices.
551 { # A vertex represents a 2D point in the image.
552 # NOTE: the vertex coordinates are in the same scale as the original image.
553 "y": 42, # Y coordinate.
554 "x": 42, # X coordinate.
555 },
556 ],
557 },
558 "text": "A String", # The actual UTF-8 representation of the symbol.
559 "property": { # Additional information detected on the structural component. # Additional information detected for the symbol.
560 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
561 "isPrefix": True or False, # True if break prepends the element.
562 "type": "A String", # Detected break type.
563 },
564 "detectedLanguages": [ # A list of detected languages together with confidence.
565 { # Detected language for a structural component.
566 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
567 # information, see
568 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
569 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
570 },
571 ],
572 },
573 },
574 ],
575 "property": { # Additional information detected on the structural component. # Additional information detected for the word.
576 "detectedBreak": { # Detected start or end of a structural component. # Detected start or end of a text segment.
577 "isPrefix": True or False, # True if break prepends the element.
578 "type": "A String", # Detected break type.
579 },
580 "detectedLanguages": [ # A list of detected languages together with confidence.
581 { # Detected language for a structural component.
582 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
583 # information, see
584 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
585 "confidence": 3.14, # Confidence of detected language. Range [0, 1].
586 },
587 ],
588 },
589 },
590 ],
591 },
592 ],
593 },
594 ],
595 "height": 42, # Page height in pixels.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400596 },
597 ],
598 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800599 "labelAnnotations": [ # If present, label detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700600 { # Set of detected entity features.
601 "confidence": 3.14, # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800602 # For example, for an image in which the "Eiffel Tower" entity is detected,
603 # this field represents the confidence that there is a tower in the query
604 # image. Range [0, 1].
605 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700606 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800607 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700608 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800609 # image. For example, the relevancy of "tower" is likely higher to an image
610 # containing the detected "Eiffel Tower" than to an image containing a
611 # detected distant towering building, even though the confidence that
612 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700613 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800614 # `LocationInfo` elements can be present because one location may
615 # indicate the location of the scene in the image, and another location
616 # may indicate the location of the place where the image was taken.
617 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700618 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800619 "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 -0700620 # of doubles representing degrees latitude and degrees longitude. Unless
621 # specified otherwise, this must conform to the
622 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
623 # standard</a>. Values must be within normalized ranges.
624 #
625 # Example of normalization code in Python:
626 #
627 # def NormalizeLongitude(longitude):
628 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
629 # q, r = divmod(longitude, 360.0)
630 # if r > 180.0 or (r == 180.0 and q <= -1.0):
631 # return r - 360.0
632 # return r
633 #
634 # def NormalizeLatLng(latitude, longitude):
635 # """Wraps decimal degrees latitude and longitude to
636 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
637 # r = latitude % 360.0
638 # if r <= 90.0:
639 # return r, NormalizeLongitude(longitude)
640 # elif r >= 270.0:
641 # return r - 360, NormalizeLongitude(longitude)
642 # else:
643 # return 180 - r, NormalizeLongitude(longitude + 180.0)
644 #
645 # assert 180.0 == NormalizeLongitude(180.0)
646 # assert -180.0 == NormalizeLongitude(-180.0)
647 # assert -179.0 == NormalizeLongitude(181.0)
648 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
649 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
650 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
651 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
652 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
653 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
654 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
655 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
656 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
657 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400658 #
659 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
660 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700661 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
662 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
663 },
664 },
665 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400666 "mid": "A String", # Opaque entity ID. Some IDs may be available in
667 # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700668 "score": 3.14, # Overall score of the result. Range [0, 1].
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800669 "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 -0700670 # for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s
671 # are produced for the entire text detected in an image region, followed by
672 # `boundingPoly`s for each word within the detected text.
673 "vertices": [ # The bounding polygon vertices.
674 { # A vertex represents a 2D point in the image.
675 # NOTE: the vertex coordinates are in the same scale as the original image.
676 "y": 42, # Y coordinate.
677 "x": 42, # X coordinate.
678 },
679 ],
680 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800681 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
682 # fields, such a score or string that qualifies the entity.
683 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400684 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700685 "name": "A String", # Name of the property.
686 "value": "A String", # Value of the property.
687 },
688 ],
689 },
690 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800691 "imagePropertiesAnnotation": { # Stores image properties, such as dominant colors. # If present, image properties were extracted successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700692 "dominantColors": { # Set of dominant colors and their corresponding scores. # If present, dominant colors completed successfully.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800693 "colors": [ # RGB color values with their score and pixel fraction.
694 { # Color information consists of RGB channels, score, and the fraction of
695 # the image that the color occupies in the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700696 "color": { # Represents a color in the RGBA color space. This representation is designed # RGB components of the color.
697 # for simplicity of conversion to/from color representations in various
698 # languages over compactness; for example, the fields of this representation
699 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
700 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
701 # method in iOS; and, with just a little work, it can be easily formatted into
702 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
703 #
704 # Example (Java):
705 #
706 # import com.google.type.Color;
707 #
708 # // ...
709 # public static java.awt.Color fromProto(Color protocolor) {
710 # float alpha = protocolor.hasAlpha()
711 # ? protocolor.getAlpha().getValue()
712 # : 1.0;
713 #
714 # return new java.awt.Color(
715 # protocolor.getRed(),
716 # protocolor.getGreen(),
717 # protocolor.getBlue(),
718 # alpha);
719 # }
720 #
721 # public static Color toProto(java.awt.Color color) {
722 # float red = (float) color.getRed();
723 # float green = (float) color.getGreen();
724 # float blue = (float) color.getBlue();
725 # float denominator = 255.0;
726 # Color.Builder resultBuilder =
727 # Color
728 # .newBuilder()
729 # .setRed(red / denominator)
730 # .setGreen(green / denominator)
731 # .setBlue(blue / denominator);
732 # int alpha = color.getAlpha();
733 # if (alpha != 255) {
734 # result.setAlpha(
735 # FloatValue
736 # .newBuilder()
737 # .setValue(((float) alpha) / denominator)
738 # .build());
739 # }
740 # return resultBuilder.build();
741 # }
742 # // ...
743 #
744 # Example (iOS / Obj-C):
745 #
746 # // ...
747 # static UIColor* fromProto(Color* protocolor) {
748 # float red = [protocolor red];
749 # float green = [protocolor green];
750 # float blue = [protocolor blue];
751 # FloatValue* alpha_wrapper = [protocolor alpha];
752 # float alpha = 1.0;
753 # if (alpha_wrapper != nil) {
754 # alpha = [alpha_wrapper value];
755 # }
756 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
757 # }
758 #
759 # static Color* toProto(UIColor* color) {
760 # CGFloat red, green, blue, alpha;
761 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
762 # return nil;
763 # }
764 # Color* result = [Color alloc] init];
765 # [result setRed:red];
766 # [result setGreen:green];
767 # [result setBlue:blue];
768 # if (alpha <= 0.9999) {
769 # [result setAlpha:floatWrapperWithValue(alpha)];
770 # }
771 # [result autorelease];
772 # return result;
773 # }
774 # // ...
775 #
776 # Example (JavaScript):
777 #
778 # // ...
779 #
780 # var protoToCssColor = function(rgb_color) {
781 # var redFrac = rgb_color.red || 0.0;
782 # var greenFrac = rgb_color.green || 0.0;
783 # var blueFrac = rgb_color.blue || 0.0;
784 # var red = Math.floor(redFrac * 255);
785 # var green = Math.floor(greenFrac * 255);
786 # var blue = Math.floor(blueFrac * 255);
787 #
788 # if (!('alpha' in rgb_color)) {
789 # return rgbToCssColor_(red, green, blue);
790 # }
791 #
792 # var alphaFrac = rgb_color.alpha.value || 0.0;
793 # var rgbParams = [red, green, blue].join(',');
794 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
795 # };
796 #
797 # var rgbToCssColor_ = function(red, green, blue) {
798 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
799 # var hexString = rgbNumber.toString(16);
800 # var missingZeros = 6 - hexString.length;
801 # var resultBuilder = ['#'];
802 # for (var i = 0; i < missingZeros; i++) {
803 # resultBuilder.push('0');
804 # }
805 # resultBuilder.push(hexString);
806 # return resultBuilder.join('');
807 # };
808 #
809 # // ...
810 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
811 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
812 # the final pixel color is defined by the equation:
813 #
814 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
815 #
816 # This means that a value of 1.0 corresponds to a solid color, whereas
817 # a value of 0.0 corresponds to a completely transparent color. This
818 # uses a wrapper message rather than a simple float scalar so that it is
819 # possible to distinguish between a default value and the value being unset.
820 # If omitted, this color object is to be rendered as a solid color
821 # (as if the alpha value had been explicitly given with a value of 1.0).
822 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
823 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
824 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800825 "pixelFraction": 3.14, # The fraction of pixels the color occupies in the image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700826 # Value in range [0, 1].
827 "score": 3.14, # Image-specific score for this color. Value in range [0, 1].
828 },
829 ],
830 },
831 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800832 "faceAnnotations": [ # If present, face detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700833 { # A face annotation object contains the results of face detection.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800834 "panAngle": 3.14, # Yaw angle, which indicates the leftward/rightward angle that the face is
835 # pointing relative to the vertical plane perpendicular to the image. Range
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700836 # [-180,180].
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700837 "sorrowLikelihood": "A String", # Sorrow likelihood.
838 "landmarkingConfidence": 3.14, # Face landmarking confidence. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700839 "detectionConfidence": 3.14, # Detection confidence. Range [0, 1].
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700840 "tiltAngle": 3.14, # Pitch angle, which indicates the upwards/downwards angle that the face is
841 # pointing relative to the image's horizontal plane. Range [-180,180].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700842 "joyLikelihood": "A String", # Joy likelihood.
843 "landmarks": [ # Detected face landmarks.
844 { # A face-specific landmark (for example, a face feature).
845 # Landmark positions may fall outside the bounds of the image
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800846 # if the face is near one or more edges of the image.
847 # Therefore it is NOT guaranteed that `0 <= x < width` or
848 # `0 <= y < height`.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700849 "position": { # A 3D position in the image, used primarily for Face detection landmarks. # Face landmark position.
850 # A valid Position must have both x and y coordinates.
851 # The position coordinates are in the same scale as the original image.
852 "y": 3.14, # Y coordinate.
853 "x": 3.14, # X coordinate.
854 "z": 3.14, # Z coordinate (or depth).
855 },
856 "type": "A String", # Face landmark type.
857 },
858 ],
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700859 "surpriseLikelihood": "A String", # Surprise likelihood.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700860 "blurredLikelihood": "A String", # Blurred likelihood.
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700861 "underExposedLikelihood": "A String", # Under-exposed likelihood.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700862 "angerLikelihood": "A String", # Anger likelihood.
863 "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 -0800864 # are in the original image's scale, as returned in `ImageParams`.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700865 # The bounding box is computed to "frame" the face in accordance with human
866 # expectations. It is based on the landmarker results.
867 # Note that one or more x and/or y coordinates may not be generated in the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800868 # `BoundingPoly` (the polygon will be unbounded) if only a partial face
869 # appears in the image to be annotated.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700870 "vertices": [ # The bounding polygon vertices.
871 { # A vertex represents a 2D point in the image.
872 # NOTE: the vertex coordinates are in the same scale as the original image.
873 "y": 42, # Y coordinate.
874 "x": 42, # X coordinate.
875 },
876 ],
877 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800878 "rollAngle": 3.14, # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
879 # of the face relative to the image vertical about the axis perpendicular to
880 # the face. Range [-180,180].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700881 "headwearLikelihood": "A String", # Headwear likelihood.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800882 "fdBoundingPoly": { # A bounding polygon for the detected image annotation. # The `fd_bounding_poly` bounding polygon is tighter than the
883 # `boundingPoly`, and encloses only the skin part of the face. Typically, it
884 # is used to eliminate the face from any image analysis that detects the
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700885 # "amount of skin" visible in an image. It is not based on the
886 # landmarker results, only on the initial face detection, hence
887 # the <code>fd</code> (face detection) prefix.
888 "vertices": [ # The bounding polygon vertices.
889 { # A vertex represents a 2D point in the image.
890 # NOTE: the vertex coordinates are in the same scale as the original image.
891 "y": 42, # Y coordinate.
892 "x": 42, # X coordinate.
893 },
894 ],
895 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700896 },
897 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800898 "logoAnnotations": [ # If present, logo detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700899 { # Set of detected entity features.
900 "confidence": 3.14, # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800901 # For example, for an image in which the "Eiffel Tower" entity is detected,
902 # this field represents the confidence that there is a tower in the query
903 # image. Range [0, 1].
904 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700905 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800906 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700907 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800908 # image. For example, the relevancy of "tower" is likely higher to an image
909 # containing the detected "Eiffel Tower" than to an image containing a
910 # detected distant towering building, even though the confidence that
911 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700912 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800913 # `LocationInfo` elements can be present because one location may
914 # indicate the location of the scene in the image, and another location
915 # may indicate the location of the place where the image was taken.
916 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700917 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800918 "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 -0700919 # of doubles representing degrees latitude and degrees longitude. Unless
920 # specified otherwise, this must conform to the
921 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
922 # standard</a>. Values must be within normalized ranges.
923 #
924 # Example of normalization code in Python:
925 #
926 # def NormalizeLongitude(longitude):
927 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
928 # q, r = divmod(longitude, 360.0)
929 # if r > 180.0 or (r == 180.0 and q <= -1.0):
930 # return r - 360.0
931 # return r
932 #
933 # def NormalizeLatLng(latitude, longitude):
934 # """Wraps decimal degrees latitude and longitude to
935 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
936 # r = latitude % 360.0
937 # if r <= 90.0:
938 # return r, NormalizeLongitude(longitude)
939 # elif r >= 270.0:
940 # return r - 360, NormalizeLongitude(longitude)
941 # else:
942 # return 180 - r, NormalizeLongitude(longitude + 180.0)
943 #
944 # assert 180.0 == NormalizeLongitude(180.0)
945 # assert -180.0 == NormalizeLongitude(-180.0)
946 # assert -179.0 == NormalizeLongitude(181.0)
947 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
948 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
949 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
950 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
951 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
952 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
953 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
954 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
955 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
956 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400957 #
958 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
959 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700960 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
961 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
962 },
963 },
964 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400965 "mid": "A String", # Opaque entity ID. Some IDs may be available in
966 # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700967 "score": 3.14, # Overall score of the result. Range [0, 1].
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800968 "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 -0700969 # for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s
970 # are produced for the entire text detected in an image region, followed by
971 # `boundingPoly`s for each word within the detected text.
972 "vertices": [ # The bounding polygon vertices.
973 { # A vertex represents a 2D point in the image.
974 # NOTE: the vertex coordinates are in the same scale as the original image.
975 "y": 42, # Y coordinate.
976 "x": 42, # X coordinate.
977 },
978 ],
979 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800980 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
981 # fields, such a score or string that qualifies the entity.
982 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400983 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700984 "name": "A String", # Name of the property.
985 "value": "A String", # Value of the property.
986 },
987 ],
988 },
989 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800990 "landmarkAnnotations": [ # If present, landmark detection has completed successfully.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700991 { # Set of detected entity features.
992 "confidence": 3.14, # The accuracy of the entity detection in an image.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800993 # For example, for an image in which the "Eiffel Tower" entity is detected,
994 # this field represents the confidence that there is a tower in the query
995 # image. Range [0, 1].
996 "description": "A String", # Entity textual description, expressed in its `locale` language.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700997 "locale": "A String", # The language code for the locale in which the entity textual
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800998 # `description` is expressed.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700999 "topicality": 3.14, # The relevancy of the ICA (Image Content Annotation) label to the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001000 # image. For example, the relevancy of "tower" is likely higher to an image
1001 # containing the detected "Eiffel Tower" than to an image containing a
1002 # detected distant towering building, even though the confidence that
1003 # there is a tower in each image may be the same. Range [0, 1].
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001004 "locations": [ # The location information for the detected entity. Multiple
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001005 # `LocationInfo` elements can be present because one location may
1006 # indicate the location of the scene in the image, and another location
1007 # may indicate the location of the place where the image was taken.
1008 # Location information is usually present for landmarks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001009 { # Detected entity location information.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001010 "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 -07001011 # of doubles representing degrees latitude and degrees longitude. Unless
1012 # specified otherwise, this must conform to the
1013 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
1014 # standard</a>. Values must be within normalized ranges.
1015 #
1016 # Example of normalization code in Python:
1017 #
1018 # def NormalizeLongitude(longitude):
1019 # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
1020 # q, r = divmod(longitude, 360.0)
1021 # if r > 180.0 or (r == 180.0 and q <= -1.0):
1022 # return r - 360.0
1023 # return r
1024 #
1025 # def NormalizeLatLng(latitude, longitude):
1026 # """Wraps decimal degrees latitude and longitude to
1027 # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
1028 # r = latitude % 360.0
1029 # if r <= 90.0:
1030 # return r, NormalizeLongitude(longitude)
1031 # elif r >= 270.0:
1032 # return r - 360, NormalizeLongitude(longitude)
1033 # else:
1034 # return 180 - r, NormalizeLongitude(longitude + 180.0)
1035 #
1036 # assert 180.0 == NormalizeLongitude(180.0)
1037 # assert -180.0 == NormalizeLongitude(-180.0)
1038 # assert -179.0 == NormalizeLongitude(181.0)
1039 # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
1040 # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
1041 # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
1042 # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
1043 # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
1044 # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
1045 # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
1046 # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
1047 # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
1048 # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001049 #
1050 # The code in logs/storage/validator/logs_validator_traits.cc treats this type
1051 # as if it were annotated as ST_LOCATION.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001052 "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1053 "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1054 },
1055 },
1056 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001057 "mid": "A String", # Opaque entity ID. Some IDs may be available in
1058 # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001059 "score": 3.14, # Overall score of the result. Range [0, 1].
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001060 "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 -07001061 # for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s
1062 # are produced for the entire text detected in an image region, followed by
1063 # `boundingPoly`s for each word within the detected text.
1064 "vertices": [ # The bounding polygon vertices.
1065 { # A vertex represents a 2D point in the image.
1066 # NOTE: the vertex coordinates are in the same scale as the original image.
1067 "y": 42, # Y coordinate.
1068 "x": 42, # X coordinate.
1069 },
1070 ],
1071 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001072 "properties": [ # Some entities may have optional user-supplied `Property` (name/value)
1073 # fields, such a score or string that qualifies the entity.
1074 { # A `Property` consists of a user-supplied name/value pair.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001075 "uint64Value": "A String", # Value of numeric properties.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001076 "name": "A String", # Name of the property.
1077 "value": "A String", # Value of the property.
1078 },
1079 ],
1080 },
1081 ],
Sai Cheemalapatie833b792017-03-24 15:06:46 -07001082 "error": { # The `Status` type defines a logical error model that is suitable for different # If set, represents the error message for the operation.
1083 # Note that filled-in image annotations are guaranteed to be
1084 # correct, even when `error` is set.
1085 # programming environments, including REST APIs and RPC APIs. It is used by
1086 # [gRPC](https://github.com/grpc). The error model is designed to be:
1087 #
1088 # - Simple to use and understand for most users
1089 # - Flexible enough to meet unexpected needs
1090 #
1091 # # Overview
1092 #
1093 # The `Status` message contains three pieces of data: error code, error message,
1094 # and error details. The error code should be an enum value of
1095 # google.rpc.Code, but it may accept additional error codes if needed. The
1096 # error message should be a developer-facing English message that helps
1097 # developers *understand* and *resolve* the error. If a localized user-facing
1098 # error message is needed, put the localized message in the error details or
1099 # localize it in the client. The optional error details may contain arbitrary
1100 # information about the error. There is a predefined set of error detail types
1101 # in the package `google.rpc` which can be used for common error conditions.
1102 #
1103 # # Language mapping
1104 #
1105 # The `Status` message is the logical representation of the error model, but it
1106 # is not necessarily the actual wire format. When the `Status` message is
1107 # exposed in different client libraries and different wire protocols, it can be
1108 # mapped differently. For example, it will likely be mapped to some exceptions
1109 # in Java, but more likely mapped to some error codes in C.
1110 #
1111 # # Other uses
1112 #
1113 # The error model and the `Status` message can be used in a variety of
1114 # environments, either with or without APIs, to provide a
1115 # consistent developer experience across different environments.
1116 #
1117 # Example uses of this error model include:
1118 #
1119 # - Partial errors. If a service needs to return partial errors to the client,
1120 # it may embed the `Status` in the normal response to indicate the partial
1121 # errors.
1122 #
1123 # - Workflow errors. A typical workflow has multiple steps. Each step may
1124 # have a `Status` message for error reporting purpose.
1125 #
1126 # - Batch operations. If a client uses batch request and batch response, the
1127 # `Status` message should be used directly inside batch response, one for
1128 # each error sub-response.
1129 #
1130 # - Asynchronous operations. If an API call embeds asynchronous operation
1131 # results in its response, the status of those operations should be
1132 # represented directly using the `Status` message.
1133 #
1134 # - Logging. If some API errors are stored in logs, the message `Status` could
1135 # be used directly after any stripping needed for security/privacy reasons.
1136 "message": "A String", # A developer-facing error message, which should be in English. Any
1137 # user-facing error message should be localized and sent in the
1138 # google.rpc.Status.details field, or localized by the client.
1139 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1140 "details": [ # A list of messages that carry the error details. There will be a
1141 # common set of message types for APIs to use.
1142 {
1143 "a_key": "", # Properties of the object. Contains field @type with type URL.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001144 },
1145 ],
1146 },
1147 "cropHintsAnnotation": { # Set of crop hints that are used to generate new crops when serving images. # If present, crop hints have completed successfully.
1148 "cropHints": [ # Crop hint results.
1149 { # Single crop hint that is used to generate a new crop when serving an image.
1150 "confidence": 3.14, # Confidence of this being a salient region. Range [0, 1].
1151 "boundingPoly": { # A bounding polygon for the detected image annotation. # The bounding polygon for the crop region. The coordinates of the bounding
1152 # box are in the original image's scale, as returned in `ImageParams`.
1153 "vertices": [ # The bounding polygon vertices.
1154 { # A vertex represents a 2D point in the image.
1155 # NOTE: the vertex coordinates are in the same scale as the original image.
1156 "y": 42, # Y coordinate.
1157 "x": 42, # X coordinate.
1158 },
1159 ],
1160 },
1161 "importanceFraction": 3.14, # Fraction of importance of this salient region with respect to the original
1162 # image.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001163 },
1164 ],
1165 },
1166 },
1167 ],
1168 }</pre>
1169</div>
1170
1171</body></html>