google-cloud-vision-v1p3beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +24 -0
  6. data/lib/google-cloud-vision-v1p3beta1.rb +1 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/vision/v1p3beta1.rb +20 -0
  9. data/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb +44 -0
  10. data/lib/google/cloud/vision/v1p3beta1/image_annotator.rb +21 -0
  11. data/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb +462 -0
  12. data/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb +52 -0
  13. data/lib/google/cloud/vision/v1p3beta1/image_annotator/helpers.rb +1228 -0
  14. data/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb +558 -0
  15. data/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb +52 -0
  16. data/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb +307 -0
  17. data/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb +55 -0
  18. data/lib/google/cloud/vision/v1p3beta1/product_search.rb +21 -0
  19. data/lib/google/cloud/vision/v1p3beta1/product_search/client.rb +2033 -0
  20. data/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb +52 -0
  21. data/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb +558 -0
  22. data/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb +109 -0
  23. data/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb +66 -0
  24. data/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb +195 -0
  25. data/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb +222 -0
  26. data/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb +95 -0
  27. data/lib/google/cloud/vision/v1p3beta1/version.rb +28 -0
  28. data/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb +52 -0
  29. data/proto_docs/README.md +4 -0
  30. data/proto_docs/google/api/field_behavior.rb +59 -0
  31. data/proto_docs/google/api/resource.rb +247 -0
  32. data/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb +91 -0
  33. data/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb +869 -0
  34. data/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb +172 -0
  35. data/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb +630 -0
  36. data/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb +286 -0
  37. data/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb +120 -0
  38. data/proto_docs/google/longrunning/operations.rb +150 -0
  39. data/proto_docs/google/protobuf/any.rb +137 -0
  40. data/proto_docs/google/protobuf/empty.rb +36 -0
  41. data/proto_docs/google/protobuf/field_mask.rb +237 -0
  42. data/proto_docs/google/protobuf/timestamp.rb +116 -0
  43. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  44. data/proto_docs/google/rpc/status.rb +46 -0
  45. data/proto_docs/google/type/color.rb +168 -0
  46. data/proto_docs/google/type/latlng.rb +38 -0
  47. metadata +201 -0
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Vision
23
+ module V1p3beta1
24
+ # A vertex represents a 2D point in the image.
25
+ # NOTE: the vertex coordinates are in the same scale as the original image.
26
+ # @!attribute [rw] x
27
+ # @return [Integer]
28
+ # X coordinate.
29
+ # @!attribute [rw] y
30
+ # @return [Integer]
31
+ # Y coordinate.
32
+ class Vertex
33
+ include Google::Protobuf::MessageExts
34
+ extend Google::Protobuf::MessageExts::ClassMethods
35
+ end
36
+
37
+ # A vertex represents a 2D point in the image.
38
+ # NOTE: the normalized vertex coordinates are relative to the original image
39
+ # and range from 0 to 1.
40
+ # @!attribute [rw] x
41
+ # @return [Float]
42
+ # X coordinate.
43
+ # @!attribute [rw] y
44
+ # @return [Float]
45
+ # Y coordinate.
46
+ class NormalizedVertex
47
+ include Google::Protobuf::MessageExts
48
+ extend Google::Protobuf::MessageExts::ClassMethods
49
+ end
50
+
51
+ # A bounding polygon for the detected image annotation.
52
+ # @!attribute [rw] vertices
53
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::Vertex>]
54
+ # The bounding polygon vertices.
55
+ # @!attribute [rw] normalized_vertices
56
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::NormalizedVertex>]
57
+ # The bounding polygon normalized vertices.
58
+ class BoundingPoly
59
+ include Google::Protobuf::MessageExts
60
+ extend Google::Protobuf::MessageExts::ClassMethods
61
+ end
62
+
63
+ # A normalized bounding polygon around a portion of an image.
64
+ # @!attribute [rw] vertices
65
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::NormalizedVertex>]
66
+ # Normalized vertices of the bounding polygon.
67
+ class NormalizedBoundingPoly
68
+ include Google::Protobuf::MessageExts
69
+ extend Google::Protobuf::MessageExts::ClassMethods
70
+ end
71
+
72
+ # A 3D position in the image, used primarily for Face detection landmarks.
73
+ # A valid Position must have both x and y coordinates.
74
+ # The position coordinates are in the same scale as the original image.
75
+ # @!attribute [rw] x
76
+ # @return [Float]
77
+ # X coordinate.
78
+ # @!attribute [rw] y
79
+ # @return [Float]
80
+ # Y coordinate.
81
+ # @!attribute [rw] z
82
+ # @return [Float]
83
+ # Z coordinate (or depth).
84
+ class Position
85
+ include Google::Protobuf::MessageExts
86
+ extend Google::Protobuf::MessageExts::ClassMethods
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,869 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Vision
23
+ module V1p3beta1
24
+ # The type of Google Cloud Vision API detection to perform, and the maximum
25
+ # number of results to return for that type. Multiple `Feature` objects can
26
+ # be specified in the `features` list.
27
+ # @!attribute [rw] type
28
+ # @return [Google::Cloud::Vision::V1p3beta1::Feature::Type]
29
+ # The feature type.
30
+ # @!attribute [rw] max_results
31
+ # @return [Integer]
32
+ # Maximum number of results of this type. Does not apply to
33
+ # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.
34
+ # @!attribute [rw] model
35
+ # @return [String]
36
+ # Model to use for the feature.
37
+ # Supported values: "builtin/stable" (the default if unset) and
38
+ # "builtin/latest".
39
+ class Feature
40
+ include Google::Protobuf::MessageExts
41
+ extend Google::Protobuf::MessageExts::ClassMethods
42
+
43
+ # Type of Google Cloud Vision API feature to be extracted.
44
+ module Type
45
+ # Unspecified feature type.
46
+ TYPE_UNSPECIFIED = 0
47
+
48
+ # Run face detection.
49
+ FACE_DETECTION = 1
50
+
51
+ # Run landmark detection.
52
+ LANDMARK_DETECTION = 2
53
+
54
+ # Run logo detection.
55
+ LOGO_DETECTION = 3
56
+
57
+ # Run label detection.
58
+ LABEL_DETECTION = 4
59
+
60
+ # Run text detection / optical character recognition (OCR). Text detection
61
+ # is optimized for areas of text within a larger image; if the image is
62
+ # a document, use `DOCUMENT_TEXT_DETECTION` instead.
63
+ TEXT_DETECTION = 5
64
+
65
+ # Run dense text document OCR. Takes precedence when both
66
+ # `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present.
67
+ DOCUMENT_TEXT_DETECTION = 11
68
+
69
+ # Run Safe Search to detect potentially unsafe
70
+ # or undesirable content.
71
+ SAFE_SEARCH_DETECTION = 6
72
+
73
+ # Compute a set of image properties, such as the
74
+ # image's dominant colors.
75
+ IMAGE_PROPERTIES = 7
76
+
77
+ # Run crop hints.
78
+ CROP_HINTS = 9
79
+
80
+ # Run web detection.
81
+ WEB_DETECTION = 10
82
+
83
+ # Run Product Search.
84
+ PRODUCT_SEARCH = 12
85
+
86
+ # Run localizer for object detection.
87
+ OBJECT_LOCALIZATION = 19
88
+ end
89
+ end
90
+
91
+ # External image source (Google Cloud Storage or web URL image location).
92
+ # @!attribute [rw] gcs_image_uri
93
+ # @return [String]
94
+ # **Use `image_uri` instead.**
95
+ #
96
+ # The Google Cloud Storage URI of the form
97
+ # `gs://bucket_name/object_name`. Object versioning is not supported. See
98
+ # [Google Cloud Storage Request
99
+ # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info.
100
+ # @!attribute [rw] image_uri
101
+ # @return [String]
102
+ # The URI of the source image. Can be either:
103
+ #
104
+ # 1. A Google Cloud Storage URI of the form
105
+ # `gs://bucket_name/object_name`. Object versioning is not supported. See
106
+ # [Google Cloud Storage Request
107
+ # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
108
+ # info.
109
+ #
110
+ # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from
111
+ # HTTP/HTTPS URLs, Google cannot guarantee that the request will be
112
+ # completed. Your request may fail if the specified host denies the
113
+ # request (e.g. due to request throttling or DOS prevention), or if Google
114
+ # throttles requests to the site for abuse prevention. You should not
115
+ # depend on externally-hosted images for production applications.
116
+ #
117
+ # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
118
+ # precedence.
119
+ class ImageSource
120
+ include Google::Protobuf::MessageExts
121
+ extend Google::Protobuf::MessageExts::ClassMethods
122
+ end
123
+
124
+ # Client image to perform Google Cloud Vision API tasks over.
125
+ # @!attribute [rw] content
126
+ # @return [String]
127
+ # Image content, represented as a stream of bytes.
128
+ # Note: As with all `bytes` fields, protobuffers use a pure binary
129
+ # representation, whereas JSON representations use base64.
130
+ # @!attribute [rw] source
131
+ # @return [Google::Cloud::Vision::V1p3beta1::ImageSource]
132
+ # Google Cloud Storage image location, or publicly-accessible image
133
+ # URL. If both `content` and `source` are provided for an image, `content`
134
+ # takes precedence and is used to perform the image annotation request.
135
+ class Image
136
+ include Google::Protobuf::MessageExts
137
+ extend Google::Protobuf::MessageExts::ClassMethods
138
+ end
139
+
140
+ # A face annotation object contains the results of face detection.
141
+ # @!attribute [rw] bounding_poly
142
+ # @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
143
+ # The bounding polygon around the face. The coordinates of the bounding box
144
+ # are in the original image's scale, as returned in `ImageParams`.
145
+ # The bounding box is computed to "frame" the face in accordance with human
146
+ # expectations. It is based on the landmarker results.
147
+ # Note that one or more x and/or y coordinates may not be generated in the
148
+ # `BoundingPoly` (the polygon will be unbounded) if only a partial face
149
+ # appears in the image to be annotated.
150
+ # @!attribute [rw] fd_bounding_poly
151
+ # @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
152
+ # The `fd_bounding_poly` bounding polygon is tighter than the
153
+ # `boundingPoly`, and encloses only the skin part of the face. Typically, it
154
+ # is used to eliminate the face from any image analysis that detects the
155
+ # "amount of skin" visible in an image. It is not based on the
156
+ # landmarker results, only on the initial face detection, hence
157
+ # the <code>fd</code> (face detection) prefix.
158
+ # @!attribute [rw] landmarks
159
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::FaceAnnotation::Landmark>]
160
+ # Detected face landmarks.
161
+ # @!attribute [rw] roll_angle
162
+ # @return [Float]
163
+ # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
164
+ # of the face relative to the image vertical about the axis perpendicular to
165
+ # the face. Range [-180,180].
166
+ # @!attribute [rw] pan_angle
167
+ # @return [Float]
168
+ # Yaw angle, which indicates the leftward/rightward angle that the face is
169
+ # pointing relative to the vertical plane perpendicular to the image. Range
170
+ # [-180,180].
171
+ # @!attribute [rw] tilt_angle
172
+ # @return [Float]
173
+ # Pitch angle, which indicates the upwards/downwards angle that the face is
174
+ # pointing relative to the image's horizontal plane. Range [-180,180].
175
+ # @!attribute [rw] detection_confidence
176
+ # @return [Float]
177
+ # Detection confidence. Range [0, 1].
178
+ # @!attribute [rw] landmarking_confidence
179
+ # @return [Float]
180
+ # Face landmarking confidence. Range [0, 1].
181
+ # @!attribute [rw] joy_likelihood
182
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
183
+ # Joy likelihood.
184
+ # @!attribute [rw] sorrow_likelihood
185
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
186
+ # Sorrow likelihood.
187
+ # @!attribute [rw] anger_likelihood
188
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
189
+ # Anger likelihood.
190
+ # @!attribute [rw] surprise_likelihood
191
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
192
+ # Surprise likelihood.
193
+ # @!attribute [rw] under_exposed_likelihood
194
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
195
+ # Under-exposed likelihood.
196
+ # @!attribute [rw] blurred_likelihood
197
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
198
+ # Blurred likelihood.
199
+ # @!attribute [rw] headwear_likelihood
200
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
201
+ # Headwear likelihood.
202
+ class FaceAnnotation
203
+ include Google::Protobuf::MessageExts
204
+ extend Google::Protobuf::MessageExts::ClassMethods
205
+
206
+ # A face-specific landmark (for example, a face feature).
207
+ # @!attribute [rw] type
208
+ # @return [Google::Cloud::Vision::V1p3beta1::FaceAnnotation::Landmark::Type]
209
+ # Face landmark type.
210
+ # @!attribute [rw] position
211
+ # @return [Google::Cloud::Vision::V1p3beta1::Position]
212
+ # Face landmark position.
213
+ class Landmark
214
+ include Google::Protobuf::MessageExts
215
+ extend Google::Protobuf::MessageExts::ClassMethods
216
+
217
+ # Face landmark (feature) type.
218
+ # Left and right are defined from the vantage of the viewer of the image
219
+ # without considering mirror projections typical of photos. So, `LEFT_EYE`,
220
+ # typically, is the person's right eye.
221
+ module Type
222
+ # Unknown face landmark detected. Should not be filled.
223
+ UNKNOWN_LANDMARK = 0
224
+
225
+ # Left eye.
226
+ LEFT_EYE = 1
227
+
228
+ # Right eye.
229
+ RIGHT_EYE = 2
230
+
231
+ # Left of left eyebrow.
232
+ LEFT_OF_LEFT_EYEBROW = 3
233
+
234
+ # Right of left eyebrow.
235
+ RIGHT_OF_LEFT_EYEBROW = 4
236
+
237
+ # Left of right eyebrow.
238
+ LEFT_OF_RIGHT_EYEBROW = 5
239
+
240
+ # Right of right eyebrow.
241
+ RIGHT_OF_RIGHT_EYEBROW = 6
242
+
243
+ # Midpoint between eyes.
244
+ MIDPOINT_BETWEEN_EYES = 7
245
+
246
+ # Nose tip.
247
+ NOSE_TIP = 8
248
+
249
+ # Upper lip.
250
+ UPPER_LIP = 9
251
+
252
+ # Lower lip.
253
+ LOWER_LIP = 10
254
+
255
+ # Mouth left.
256
+ MOUTH_LEFT = 11
257
+
258
+ # Mouth right.
259
+ MOUTH_RIGHT = 12
260
+
261
+ # Mouth center.
262
+ MOUTH_CENTER = 13
263
+
264
+ # Nose, bottom right.
265
+ NOSE_BOTTOM_RIGHT = 14
266
+
267
+ # Nose, bottom left.
268
+ NOSE_BOTTOM_LEFT = 15
269
+
270
+ # Nose, bottom center.
271
+ NOSE_BOTTOM_CENTER = 16
272
+
273
+ # Left eye, top boundary.
274
+ LEFT_EYE_TOP_BOUNDARY = 17
275
+
276
+ # Left eye, right corner.
277
+ LEFT_EYE_RIGHT_CORNER = 18
278
+
279
+ # Left eye, bottom boundary.
280
+ LEFT_EYE_BOTTOM_BOUNDARY = 19
281
+
282
+ # Left eye, left corner.
283
+ LEFT_EYE_LEFT_CORNER = 20
284
+
285
+ # Right eye, top boundary.
286
+ RIGHT_EYE_TOP_BOUNDARY = 21
287
+
288
+ # Right eye, right corner.
289
+ RIGHT_EYE_RIGHT_CORNER = 22
290
+
291
+ # Right eye, bottom boundary.
292
+ RIGHT_EYE_BOTTOM_BOUNDARY = 23
293
+
294
+ # Right eye, left corner.
295
+ RIGHT_EYE_LEFT_CORNER = 24
296
+
297
+ # Left eyebrow, upper midpoint.
298
+ LEFT_EYEBROW_UPPER_MIDPOINT = 25
299
+
300
+ # Right eyebrow, upper midpoint.
301
+ RIGHT_EYEBROW_UPPER_MIDPOINT = 26
302
+
303
+ # Left ear tragion.
304
+ LEFT_EAR_TRAGION = 27
305
+
306
+ # Right ear tragion.
307
+ RIGHT_EAR_TRAGION = 28
308
+
309
+ # Left eye pupil.
310
+ LEFT_EYE_PUPIL = 29
311
+
312
+ # Right eye pupil.
313
+ RIGHT_EYE_PUPIL = 30
314
+
315
+ # Forehead glabella.
316
+ FOREHEAD_GLABELLA = 31
317
+
318
+ # Chin gnathion.
319
+ CHIN_GNATHION = 32
320
+
321
+ # Chin left gonion.
322
+ CHIN_LEFT_GONION = 33
323
+
324
+ # Chin right gonion.
325
+ CHIN_RIGHT_GONION = 34
326
+ end
327
+ end
328
+ end
329
+
330
+ # Detected entity location information.
331
+ # @!attribute [rw] lat_lng
332
+ # @return [Google::Type::LatLng]
333
+ # lat/long location coordinates.
334
+ class LocationInfo
335
+ include Google::Protobuf::MessageExts
336
+ extend Google::Protobuf::MessageExts::ClassMethods
337
+ end
338
+
339
+ # A `Property` consists of a user-supplied name/value pair.
340
+ # @!attribute [rw] name
341
+ # @return [String]
342
+ # Name of the property.
343
+ # @!attribute [rw] value
344
+ # @return [String]
345
+ # Value of the property.
346
+ # @!attribute [rw] uint64_value
347
+ # @return [Integer]
348
+ # Value of numeric properties.
349
+ class Property
350
+ include Google::Protobuf::MessageExts
351
+ extend Google::Protobuf::MessageExts::ClassMethods
352
+ end
353
+
354
+ # Set of detected entity features.
355
+ # @!attribute [rw] mid
356
+ # @return [String]
357
+ # Opaque entity ID. Some IDs may be available in
358
+ # [Google Knowledge Graph Search
359
+ # API](https://developers.google.com/knowledge-graph/).
360
+ # @!attribute [rw] locale
361
+ # @return [String]
362
+ # The language code for the locale in which the entity textual
363
+ # `description` is expressed.
364
+ # @!attribute [rw] description
365
+ # @return [String]
366
+ # Entity textual description, expressed in its `locale` language.
367
+ # @!attribute [rw] score
368
+ # @return [Float]
369
+ # Overall score of the result. Range [0, 1].
370
+ # @!attribute [rw] confidence
371
+ # @return [Float]
372
+ # **Deprecated. Use `score` instead.**
373
+ # The accuracy of the entity detection in an image.
374
+ # For example, for an image in which the "Eiffel Tower" entity is detected,
375
+ # this field represents the confidence that there is a tower in the query
376
+ # image. Range [0, 1].
377
+ # @!attribute [rw] topicality
378
+ # @return [Float]
379
+ # The relevancy of the ICA (Image Content Annotation) label to the
380
+ # image. For example, the relevancy of "tower" is likely higher to an image
381
+ # containing the detected "Eiffel Tower" than to an image containing a
382
+ # detected distant towering building, even though the confidence that
383
+ # there is a tower in each image may be the same. Range [0, 1].
384
+ # @!attribute [rw] bounding_poly
385
+ # @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
386
+ # Image region to which this entity belongs. Not produced
387
+ # for `LABEL_DETECTION` features.
388
+ # @!attribute [rw] locations
389
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::LocationInfo>]
390
+ # The location information for the detected entity. Multiple
391
+ # `LocationInfo` elements can be present because one location may
392
+ # indicate the location of the scene in the image, and another location
393
+ # may indicate the location of the place where the image was taken.
394
+ # Location information is usually present for landmarks.
395
+ # @!attribute [rw] properties
396
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::Property>]
397
+ # Some entities may have optional user-supplied `Property` (name/value)
398
+ # fields, such a score or string that qualifies the entity.
399
+ class EntityAnnotation
400
+ include Google::Protobuf::MessageExts
401
+ extend Google::Protobuf::MessageExts::ClassMethods
402
+ end
403
+
404
+ # Set of detected objects with bounding boxes.
405
+ # @!attribute [rw] mid
406
+ # @return [String]
407
+ # Object ID that should align with EntityAnnotation mid.
408
+ # @!attribute [rw] language_code
409
+ # @return [String]
410
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
411
+ # information, see
412
+ # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
413
+ # @!attribute [rw] name
414
+ # @return [String]
415
+ # Object name, expressed in its `language_code` language.
416
+ # @!attribute [rw] score
417
+ # @return [Float]
418
+ # Score of the result. Range [0, 1].
419
+ # @!attribute [rw] bounding_poly
420
+ # @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
421
+ # Image region to which this object belongs. This must be populated.
422
+ class LocalizedObjectAnnotation
423
+ include Google::Protobuf::MessageExts
424
+ extend Google::Protobuf::MessageExts::ClassMethods
425
+ end
426
+
427
+ # Set of features pertaining to the image, computed by computer vision
428
+ # methods over safe-search verticals (for example, adult, spoof, medical,
429
+ # violence).
430
+ # @!attribute [rw] adult
431
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
432
+ # Represents the adult content likelihood for the image. Adult content may
433
+ # contain elements such as nudity, pornographic images or cartoons, or
434
+ # sexual activities.
435
+ # @!attribute [rw] spoof
436
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
437
+ # Spoof likelihood. The likelihood that an modification
438
+ # was made to the image's canonical version to make it appear
439
+ # funny or offensive.
440
+ # @!attribute [rw] medical
441
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
442
+ # Likelihood that this is a medical image.
443
+ # @!attribute [rw] violence
444
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
445
+ # Likelihood that this image contains violent content.
446
+ # @!attribute [rw] racy
447
+ # @return [Google::Cloud::Vision::V1p3beta1::Likelihood]
448
+ # Likelihood that the request image contains racy content. Racy content may
449
+ # include (but is not limited to) skimpy or sheer clothing, strategically
450
+ # covered nudity, lewd or provocative poses, or close-ups of sensitive
451
+ # body areas.
452
+ class SafeSearchAnnotation
453
+ include Google::Protobuf::MessageExts
454
+ extend Google::Protobuf::MessageExts::ClassMethods
455
+ end
456
+
457
+ # Rectangle determined by min and max `LatLng` pairs.
458
+ # @!attribute [rw] min_lat_lng
459
+ # @return [Google::Type::LatLng]
460
+ # Min lat/long pair.
461
+ # @!attribute [rw] max_lat_lng
462
+ # @return [Google::Type::LatLng]
463
+ # Max lat/long pair.
464
+ class LatLongRect
465
+ include Google::Protobuf::MessageExts
466
+ extend Google::Protobuf::MessageExts::ClassMethods
467
+ end
468
+
469
+ # Color information consists of RGB channels, score, and the fraction of
470
+ # the image that the color occupies in the image.
471
+ # @!attribute [rw] color
472
+ # @return [Google::Type::Color]
473
+ # RGB components of the color.
474
+ # @!attribute [rw] score
475
+ # @return [Float]
476
+ # Image-specific score for this color. Value in range [0, 1].
477
+ # @!attribute [rw] pixel_fraction
478
+ # @return [Float]
479
+ # The fraction of pixels the color occupies in the image.
480
+ # Value in range [0, 1].
481
+ class ColorInfo
482
+ include Google::Protobuf::MessageExts
483
+ extend Google::Protobuf::MessageExts::ClassMethods
484
+ end
485
+
486
+ # Set of dominant colors and their corresponding scores.
487
+ # @!attribute [rw] colors
488
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::ColorInfo>]
489
+ # RGB color values with their score and pixel fraction.
490
+ class DominantColorsAnnotation
491
+ include Google::Protobuf::MessageExts
492
+ extend Google::Protobuf::MessageExts::ClassMethods
493
+ end
494
+
495
+ # Stores image properties, such as dominant colors.
496
+ # @!attribute [rw] dominant_colors
497
+ # @return [Google::Cloud::Vision::V1p3beta1::DominantColorsAnnotation]
498
+ # If present, dominant colors completed successfully.
499
+ class ImageProperties
500
+ include Google::Protobuf::MessageExts
501
+ extend Google::Protobuf::MessageExts::ClassMethods
502
+ end
503
+
504
+ # Single crop hint that is used to generate a new crop when serving an image.
505
+ # @!attribute [rw] bounding_poly
506
+ # @return [Google::Cloud::Vision::V1p3beta1::BoundingPoly]
507
+ # The bounding polygon for the crop region. The coordinates of the bounding
508
+ # box are in the original image's scale, as returned in `ImageParams`.
509
+ # @!attribute [rw] confidence
510
+ # @return [Float]
511
+ # Confidence of this being a salient region. Range [0, 1].
512
+ # @!attribute [rw] importance_fraction
513
+ # @return [Float]
514
+ # Fraction of importance of this salient region with respect to the original
515
+ # image.
516
+ class CropHint
517
+ include Google::Protobuf::MessageExts
518
+ extend Google::Protobuf::MessageExts::ClassMethods
519
+ end
520
+
521
+ # Set of crop hints that are used to generate new crops when serving images.
522
+ # @!attribute [rw] crop_hints
523
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::CropHint>]
524
+ # Crop hint results.
525
+ class CropHintsAnnotation
526
+ include Google::Protobuf::MessageExts
527
+ extend Google::Protobuf::MessageExts::ClassMethods
528
+ end
529
+
530
+ # Parameters for crop hints annotation request.
531
+ # @!attribute [rw] aspect_ratios
532
+ # @return [Array<Float>]
533
+ # Aspect ratios in floats, representing the ratio of the width to the height
534
+ # of the image. For example, if the desired aspect ratio is 4/3, the
535
+ # corresponding float value should be 1.33333. If not specified, the
536
+ # best possible crop is returned. The number of provided aspect ratios is
537
+ # limited to a maximum of 16; any aspect ratios provided after the 16th are
538
+ # ignored.
539
+ class CropHintsParams
540
+ include Google::Protobuf::MessageExts
541
+ extend Google::Protobuf::MessageExts::ClassMethods
542
+ end
543
+
544
+ # Parameters for web detection request.
545
+ # @!attribute [rw] include_geo_results
546
+ # @return [Boolean]
547
+ # Whether to include results derived from the geo information in the image.
548
+ class WebDetectionParams
549
+ include Google::Protobuf::MessageExts
550
+ extend Google::Protobuf::MessageExts::ClassMethods
551
+ end
552
+
553
+ # Image context and/or feature-specific parameters.
554
+ # @!attribute [rw] lat_long_rect
555
+ # @return [Google::Cloud::Vision::V1p3beta1::LatLongRect]
556
+ # Not used.
557
+ # @!attribute [rw] language_hints
558
+ # @return [Array<String>]
559
+ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
560
+ # yields the best results since it enables automatic language detection. For
561
+ # languages based on the Latin alphabet, setting `language_hints` is not
562
+ # needed. In rare cases, when the language of the text in the image is known,
563
+ # setting a hint will help get better results (although it will be a
564
+ # significant hindrance if the hint is wrong). Text detection returns an
565
+ # error if one or more of the specified languages is not one of the
566
+ # [supported languages](/vision/docs/languages).
567
+ # @!attribute [rw] crop_hints_params
568
+ # @return [Google::Cloud::Vision::V1p3beta1::CropHintsParams]
569
+ # Parameters for crop hints annotation request.
570
+ # @!attribute [rw] product_search_params
571
+ # @return [Google::Cloud::Vision::V1p3beta1::ProductSearchParams]
572
+ # Parameters for product search.
573
+ # @!attribute [rw] web_detection_params
574
+ # @return [Google::Cloud::Vision::V1p3beta1::WebDetectionParams]
575
+ # Parameters for web detection.
576
+ class ImageContext
577
+ include Google::Protobuf::MessageExts
578
+ extend Google::Protobuf::MessageExts::ClassMethods
579
+ end
580
+
581
+ # Request for performing Google Cloud Vision API tasks over a user-provided
582
+ # image, with user-requested features.
583
+ # @!attribute [rw] image
584
+ # @return [Google::Cloud::Vision::V1p3beta1::Image]
585
+ # The image to be processed.
586
+ # @!attribute [rw] features
587
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::Feature>]
588
+ # Requested features.
589
+ # @!attribute [rw] image_context
590
+ # @return [Google::Cloud::Vision::V1p3beta1::ImageContext]
591
+ # Additional context that may accompany the image.
592
+ class AnnotateImageRequest
593
+ include Google::Protobuf::MessageExts
594
+ extend Google::Protobuf::MessageExts::ClassMethods
595
+ end
596
+
597
+ # If an image was produced from a file (e.g. a PDF), this message gives
598
+ # information about the source of that image.
599
+ # @!attribute [rw] uri
600
+ # @return [String]
601
+ # The URI of the file used to produce the image.
602
+ # @!attribute [rw] page_number
603
+ # @return [Integer]
604
+ # If the file was a PDF or TIFF, this field gives the page number within
605
+ # the file used to produce the image.
606
+ class ImageAnnotationContext
607
+ include Google::Protobuf::MessageExts
608
+ extend Google::Protobuf::MessageExts::ClassMethods
609
+ end
610
+
611
+ # Response to an image annotation request.
612
+ # @!attribute [rw] face_annotations
613
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::FaceAnnotation>]
614
+ # If present, face detection has completed successfully.
615
+ # @!attribute [rw] landmark_annotations
616
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::EntityAnnotation>]
617
+ # If present, landmark detection has completed successfully.
618
+ # @!attribute [rw] logo_annotations
619
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::EntityAnnotation>]
620
+ # If present, logo detection has completed successfully.
621
+ # @!attribute [rw] label_annotations
622
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::EntityAnnotation>]
623
+ # If present, label detection has completed successfully.
624
+ # @!attribute [rw] localized_object_annotations
625
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::LocalizedObjectAnnotation>]
626
+ # If present, localized object detection has completed successfully.
627
+ # This will be sorted descending by confidence score.
628
+ # @!attribute [rw] text_annotations
629
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::EntityAnnotation>]
630
+ # If present, text (OCR) detection has completed successfully.
631
+ # @!attribute [rw] full_text_annotation
632
+ # @return [Google::Cloud::Vision::V1p3beta1::TextAnnotation]
633
+ # If present, text (OCR) detection or document (OCR) text detection has
634
+ # completed successfully.
635
+ # This annotation provides the structural hierarchy for the OCR detected
636
+ # text.
637
+ # @!attribute [rw] safe_search_annotation
638
+ # @return [Google::Cloud::Vision::V1p3beta1::SafeSearchAnnotation]
639
+ # If present, safe-search annotation has completed successfully.
640
+ # @!attribute [rw] image_properties_annotation
641
+ # @return [Google::Cloud::Vision::V1p3beta1::ImageProperties]
642
+ # If present, image properties were extracted successfully.
643
+ # @!attribute [rw] crop_hints_annotation
644
+ # @return [Google::Cloud::Vision::V1p3beta1::CropHintsAnnotation]
645
+ # If present, crop hints have completed successfully.
646
+ # @!attribute [rw] web_detection
647
+ # @return [Google::Cloud::Vision::V1p3beta1::WebDetection]
648
+ # If present, web detection has completed successfully.
649
+ # @!attribute [rw] product_search_results
650
+ # @return [Google::Cloud::Vision::V1p3beta1::ProductSearchResults]
651
+ # If present, product search has completed successfully.
652
+ # @!attribute [rw] error
653
+ # @return [Google::Rpc::Status]
654
+ # If set, represents the error message for the operation.
655
+ # Note that filled-in image annotations are guaranteed to be
656
+ # correct, even when `error` is set.
657
+ # @!attribute [rw] context
658
+ # @return [Google::Cloud::Vision::V1p3beta1::ImageAnnotationContext]
659
+ # If present, contextual information is needed to understand where this image
660
+ # comes from.
661
+ class AnnotateImageResponse
662
+ include Google::Protobuf::MessageExts
663
+ extend Google::Protobuf::MessageExts::ClassMethods
664
+ end
665
+
666
+ # Response to a single file annotation request. A file may contain one or more
667
+ # images, which individually have their own responses.
668
+ # @!attribute [rw] input_config
669
+ # @return [Google::Cloud::Vision::V1p3beta1::InputConfig]
670
+ # Information about the file for which this response is generated.
671
+ # @!attribute [rw] responses
672
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::AnnotateImageResponse>]
673
+ # Individual responses to images found within the file.
674
+ class AnnotateFileResponse
675
+ include Google::Protobuf::MessageExts
676
+ extend Google::Protobuf::MessageExts::ClassMethods
677
+ end
678
+
679
+ # Multiple image annotation requests are batched into a single service call.
680
+ # @!attribute [rw] requests
681
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest>]
682
+ # Individual image annotation requests for this batch.
683
+ class BatchAnnotateImagesRequest
684
+ include Google::Protobuf::MessageExts
685
+ extend Google::Protobuf::MessageExts::ClassMethods
686
+ end
687
+
688
+ # Response to a batch image annotation request.
689
+ # @!attribute [rw] responses
690
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::AnnotateImageResponse>]
691
+ # Individual responses to image annotation requests within the batch.
692
+ class BatchAnnotateImagesResponse
693
+ include Google::Protobuf::MessageExts
694
+ extend Google::Protobuf::MessageExts::ClassMethods
695
+ end
696
+
697
+ # An offline file annotation request.
698
+ # @!attribute [rw] input_config
699
+ # @return [Google::Cloud::Vision::V1p3beta1::InputConfig]
700
+ # Required. Information about the input file.
701
+ # @!attribute [rw] features
702
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::Feature>]
703
+ # Required. Requested features.
704
+ # @!attribute [rw] image_context
705
+ # @return [Google::Cloud::Vision::V1p3beta1::ImageContext]
706
+ # Additional context that may accompany the image(s) in the file.
707
+ # @!attribute [rw] output_config
708
+ # @return [Google::Cloud::Vision::V1p3beta1::OutputConfig]
709
+ # Required. The desired output location and metadata (e.g. format).
710
+ class AsyncAnnotateFileRequest
711
+ include Google::Protobuf::MessageExts
712
+ extend Google::Protobuf::MessageExts::ClassMethods
713
+ end
714
+
715
+ # The response for a single offline file annotation request.
716
+ # @!attribute [rw] output_config
717
+ # @return [Google::Cloud::Vision::V1p3beta1::OutputConfig]
718
+ # The output location and metadata from AsyncAnnotateFileRequest.
719
+ class AsyncAnnotateFileResponse
720
+ include Google::Protobuf::MessageExts
721
+ extend Google::Protobuf::MessageExts::ClassMethods
722
+ end
723
+
724
+ # Multiple async file annotation requests are batched into a single service
725
+ # call.
726
+ # @!attribute [rw] requests
727
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest>]
728
+ # Required. Individual async file annotation requests for this batch.
729
+ class AsyncBatchAnnotateFilesRequest
730
+ include Google::Protobuf::MessageExts
731
+ extend Google::Protobuf::MessageExts::ClassMethods
732
+ end
733
+
734
+ # Response to an async batch file annotation request.
735
+ # @!attribute [rw] responses
736
+ # @return [Array<Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileResponse>]
737
+ # The list of file annotation responses, one for each request in
738
+ # AsyncBatchAnnotateFilesRequest.
739
+ class AsyncBatchAnnotateFilesResponse
740
+ include Google::Protobuf::MessageExts
741
+ extend Google::Protobuf::MessageExts::ClassMethods
742
+ end
743
+
744
+ # The desired input location and metadata.
745
+ # @!attribute [rw] gcs_source
746
+ # @return [Google::Cloud::Vision::V1p3beta1::GcsSource]
747
+ # The Google Cloud Storage location to read the input from.
748
+ # @!attribute [rw] mime_type
749
+ # @return [String]
750
+ # The type of the file. Currently only "application/pdf" and "image/tiff"
751
+ # are supported. Wildcards are not supported.
752
+ class InputConfig
753
+ include Google::Protobuf::MessageExts
754
+ extend Google::Protobuf::MessageExts::ClassMethods
755
+ end
756
+
757
+ # The desired output location and metadata.
758
+ # @!attribute [rw] gcs_destination
759
+ # @return [Google::Cloud::Vision::V1p3beta1::GcsDestination]
760
+ # The Google Cloud Storage location to write the output(s) to.
761
+ # @!attribute [rw] batch_size
762
+ # @return [Integer]
763
+ # The max number of response protos to put into each output JSON file on
764
+ # Google Cloud Storage.
765
+ # The valid range is [1, 100]. If not specified, the default value is 20.
766
+ #
767
+ # For example, for one pdf file with 100 pages, 100 response protos will
768
+ # be generated. If `batch_size` = 20, then 5 json files each
769
+ # containing 20 response protos will be written under the prefix
770
+ # `gcs_destination`.`uri`.
771
+ #
772
+ # Currently, batch_size only applies to GcsDestination, with potential future
773
+ # support for other output configurations.
774
+ class OutputConfig
775
+ include Google::Protobuf::MessageExts
776
+ extend Google::Protobuf::MessageExts::ClassMethods
777
+ end
778
+
779
+ # The Google Cloud Storage location where the input will be read from.
780
+ # @!attribute [rw] uri
781
+ # @return [String]
782
+ # Google Cloud Storage URI for the input file. This must only be a
783
+ # Google Cloud Storage object. Wildcards are not currently supported.
784
+ class GcsSource
785
+ include Google::Protobuf::MessageExts
786
+ extend Google::Protobuf::MessageExts::ClassMethods
787
+ end
788
+
789
+ # The Google Cloud Storage location where the output will be written to.
790
+ # @!attribute [rw] uri
791
+ # @return [String]
792
+ # Google Cloud Storage URI where the results will be stored. Results will
793
+ # be in JSON format and preceded by its corresponding input URI. This field
794
+ # can either represent a single file, or a prefix for multiple outputs.
795
+ # Prefixes must end in a `/`.
796
+ #
797
+ # Examples:
798
+ #
799
+ # * File: gs://bucket-name/filename.json
800
+ # * Prefix: gs://bucket-name/prefix/here/
801
+ # * File: gs://bucket-name/prefix/here
802
+ #
803
+ # If multiple outputs, each response is still AnnotateFileResponse, each of
804
+ # which contains some subset of the full list of AnnotateImageResponse.
805
+ # Multiple outputs can happen if, for example, the output JSON is too large
806
+ # and overflows into multiple sharded files.
807
+ class GcsDestination
808
+ include Google::Protobuf::MessageExts
809
+ extend Google::Protobuf::MessageExts::ClassMethods
810
+ end
811
+
812
+ # Contains metadata for the BatchAnnotateImages operation.
813
+ # @!attribute [rw] state
814
+ # @return [Google::Cloud::Vision::V1p3beta1::OperationMetadata::State]
815
+ # Current state of the batch operation.
816
+ # @!attribute [rw] create_time
817
+ # @return [Google::Protobuf::Timestamp]
818
+ # The time when the batch request was received.
819
+ # @!attribute [rw] update_time
820
+ # @return [Google::Protobuf::Timestamp]
821
+ # The time when the operation result was last updated.
822
+ class OperationMetadata
823
+ include Google::Protobuf::MessageExts
824
+ extend Google::Protobuf::MessageExts::ClassMethods
825
+
826
+ # Batch operation states.
827
+ module State
828
+ # Invalid.
829
+ STATE_UNSPECIFIED = 0
830
+
831
+ # Request is received.
832
+ CREATED = 1
833
+
834
+ # Request is actively being processed.
835
+ RUNNING = 2
836
+
837
+ # The batch processing is done.
838
+ DONE = 3
839
+
840
+ # The batch processing was cancelled.
841
+ CANCELLED = 4
842
+ end
843
+ end
844
+
845
+ # A bucketized representation of likelihood, which is intended to give clients
846
+ # highly stable results across model upgrades.
847
+ module Likelihood
848
+ # Unknown likelihood.
849
+ UNKNOWN = 0
850
+
851
+ # It is very unlikely that the image belongs to the specified vertical.
852
+ VERY_UNLIKELY = 1
853
+
854
+ # It is unlikely that the image belongs to the specified vertical.
855
+ UNLIKELY = 2
856
+
857
+ # It is possible that the image belongs to the specified vertical.
858
+ POSSIBLE = 3
859
+
860
+ # It is likely that the image belongs to the specified vertical.
861
+ LIKELY = 4
862
+
863
+ # It is very likely that the image belongs to the specified vertical.
864
+ VERY_LIKELY = 5
865
+ end
866
+ end
867
+ end
868
+ end
869
+ end