google-cloud-vision 0.38.0 → 1.0.0

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