google-cloud-vision-v1 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +24 -0
- data/lib/google-cloud-vision-v1.rb +1 -0
- data/lib/google/cloud/common_resources_pb.rb +15 -0
- data/lib/google/cloud/vision/v1.rb +20 -0
- data/lib/google/cloud/vision/v1/geometry_pb.rb +40 -0
- data/lib/google/cloud/vision/v1/image_annotator.rb +21 -0
- data/lib/google/cloud/vision/v1/image_annotator/client.rb +682 -0
- data/lib/google/cloud/vision/v1/image_annotator/credentials.rb +52 -0
- data/lib/google/cloud/vision/v1/image_annotator/helpers.rb +1228 -0
- data/lib/google/cloud/vision/v1/image_annotator/operations.rb +558 -0
- data/lib/google/cloud/vision/v1/image_annotator/paths.rb +52 -0
- data/lib/google/cloud/vision/v1/image_annotator_pb.rb +345 -0
- data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +73 -0
- data/lib/google/cloud/vision/v1/product_search.rb +21 -0
- data/lib/google/cloud/vision/v1/product_search/client.rb +2134 -0
- data/lib/google/cloud/vision/v1/product_search/credentials.rb +52 -0
- data/lib/google/cloud/vision/v1/product_search/operations.rb +558 -0
- data/lib/google/cloud/vision/v1/product_search/paths.rb +109 -0
- data/lib/google/cloud/vision/v1/product_search_pb.rb +55 -0
- data/lib/google/cloud/vision/v1/product_search_service_pb.rb +208 -0
- data/lib/google/cloud/vision/v1/product_search_service_services_pb.rb +232 -0
- data/lib/google/cloud/vision/v1/text_annotation_pb.rb +95 -0
- data/lib/google/cloud/vision/v1/version.rb +28 -0
- data/lib/google/cloud/vision/v1/web_detection_pb.rb +52 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/cloud/vision/v1/geometry.rb +82 -0
- data/proto_docs/google/cloud/vision/v1/image_annotator.rb +1044 -0
- data/proto_docs/google/cloud/vision/v1/product_search.rb +134 -0
- data/proto_docs/google/cloud/vision/v1/product_search_service.rb +669 -0
- data/proto_docs/google/cloud/vision/v1/text_annotation.rb +285 -0
- data/proto_docs/google/cloud/vision/v1/web_detection.rb +121 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +137 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +237 -0
- data/proto_docs/google/protobuf/timestamp.rb +116 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/color.rb +168 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- metadata +201 -0
@@ -0,0 +1,82 @@
|
|
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 V1
|
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::V1::Vertex>]
|
54
|
+
# The bounding polygon vertices.
|
55
|
+
# @!attribute [rw] normalized_vertices
|
56
|
+
# @return [Array<Google::Cloud::Vision::V1::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 3D position in the image, used primarily for Face detection landmarks.
|
64
|
+
# A valid Position must have both x and y coordinates.
|
65
|
+
# The position coordinates are in the same scale as the original image.
|
66
|
+
# @!attribute [rw] x
|
67
|
+
# @return [Float]
|
68
|
+
# X coordinate.
|
69
|
+
# @!attribute [rw] y
|
70
|
+
# @return [Float]
|
71
|
+
# Y coordinate.
|
72
|
+
# @!attribute [rw] z
|
73
|
+
# @return [Float]
|
74
|
+
# Z coordinate (or depth).
|
75
|
+
class Position
|
76
|
+
include Google::Protobuf::MessageExts
|
77
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,1044 @@
|
|
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 V1
|
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::V1::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::V1::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::V1::BoundingPoly]
|
143
|
+
# The bounding polygon around the face. The coordinates of the bounding box
|
144
|
+
# are in the original image's scale.
|
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::V1::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::V1::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::V1::Likelihood]
|
183
|
+
# Joy likelihood.
|
184
|
+
# @!attribute [rw] sorrow_likelihood
|
185
|
+
# @return [Google::Cloud::Vision::V1::Likelihood]
|
186
|
+
# Sorrow likelihood.
|
187
|
+
# @!attribute [rw] anger_likelihood
|
188
|
+
# @return [Google::Cloud::Vision::V1::Likelihood]
|
189
|
+
# Anger likelihood.
|
190
|
+
# @!attribute [rw] surprise_likelihood
|
191
|
+
# @return [Google::Cloud::Vision::V1::Likelihood]
|
192
|
+
# Surprise likelihood.
|
193
|
+
# @!attribute [rw] under_exposed_likelihood
|
194
|
+
# @return [Google::Cloud::Vision::V1::Likelihood]
|
195
|
+
# Under-exposed likelihood.
|
196
|
+
# @!attribute [rw] blurred_likelihood
|
197
|
+
# @return [Google::Cloud::Vision::V1::Likelihood]
|
198
|
+
# Blurred likelihood.
|
199
|
+
# @!attribute [rw] headwear_likelihood
|
200
|
+
# @return [Google::Cloud::Vision::V1::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::V1::FaceAnnotation::Landmark::Type]
|
209
|
+
# Face landmark type.
|
210
|
+
# @!attribute [rw] position
|
211
|
+
# @return [Google::Cloud::Vision::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::Likelihood]
|
442
|
+
# Likelihood that this is a medical image.
|
443
|
+
# @!attribute [rw] violence
|
444
|
+
# @return [Google::Cloud::Vision::V1::Likelihood]
|
445
|
+
# Likelihood that this image contains violent content.
|
446
|
+
# @!attribute [rw] racy
|
447
|
+
# @return [Google::Cloud::Vision::V1::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
|
+
# @!attribute [rw] adult_confidence
|
453
|
+
# @return [Float]
|
454
|
+
# Confidence of adult_score. Range [0, 1]. 0 means not confident, 1 means
|
455
|
+
# very confident.
|
456
|
+
# @!attribute [rw] spoof_confidence
|
457
|
+
# @return [Float]
|
458
|
+
# Confidence of spoof_score. Range [0, 1]. 0 means not confident, 1 means
|
459
|
+
# very confident.
|
460
|
+
# @!attribute [rw] medical_confidence
|
461
|
+
# @return [Float]
|
462
|
+
# Confidence of medical_score. Range [0, 1]. 0 means not confident, 1 means
|
463
|
+
# very confident.
|
464
|
+
# @!attribute [rw] violence_confidence
|
465
|
+
# @return [Float]
|
466
|
+
# Confidence of violence_score. Range [0, 1]. 0 means not confident, 1 means
|
467
|
+
# very confident.
|
468
|
+
# @!attribute [rw] racy_confidence
|
469
|
+
# @return [Float]
|
470
|
+
# Confidence of racy_score. Range [0, 1]. 0 means not confident, 1 means very
|
471
|
+
# confident.
|
472
|
+
# @!attribute [rw] nsfw_confidence
|
473
|
+
# @return [Float]
|
474
|
+
# Confidence of nsfw_score. Range [0, 1]. 0 means not confident, 1 means very
|
475
|
+
# confident.
|
476
|
+
class SafeSearchAnnotation
|
477
|
+
include Google::Protobuf::MessageExts
|
478
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
479
|
+
end
|
480
|
+
|
481
|
+
# Rectangle determined by min and max `LatLng` pairs.
|
482
|
+
# @!attribute [rw] min_lat_lng
|
483
|
+
# @return [Google::Type::LatLng]
|
484
|
+
# Min lat/long pair.
|
485
|
+
# @!attribute [rw] max_lat_lng
|
486
|
+
# @return [Google::Type::LatLng]
|
487
|
+
# Max lat/long pair.
|
488
|
+
class LatLongRect
|
489
|
+
include Google::Protobuf::MessageExts
|
490
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
491
|
+
end
|
492
|
+
|
493
|
+
# Color information consists of RGB channels, score, and the fraction of
|
494
|
+
# the image that the color occupies in the image.
|
495
|
+
# @!attribute [rw] color
|
496
|
+
# @return [Google::Type::Color]
|
497
|
+
# RGB components of the color.
|
498
|
+
# @!attribute [rw] score
|
499
|
+
# @return [Float]
|
500
|
+
# Image-specific score for this color. Value in range [0, 1].
|
501
|
+
# @!attribute [rw] pixel_fraction
|
502
|
+
# @return [Float]
|
503
|
+
# The fraction of pixels the color occupies in the image.
|
504
|
+
# Value in range [0, 1].
|
505
|
+
class ColorInfo
|
506
|
+
include Google::Protobuf::MessageExts
|
507
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
508
|
+
end
|
509
|
+
|
510
|
+
# Set of dominant colors and their corresponding scores.
|
511
|
+
# @!attribute [rw] colors
|
512
|
+
# @return [Array<Google::Cloud::Vision::V1::ColorInfo>]
|
513
|
+
# RGB color values with their score and pixel fraction.
|
514
|
+
class DominantColorsAnnotation
|
515
|
+
include Google::Protobuf::MessageExts
|
516
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
517
|
+
end
|
518
|
+
|
519
|
+
# Stores image properties, such as dominant colors.
|
520
|
+
# @!attribute [rw] dominant_colors
|
521
|
+
# @return [Google::Cloud::Vision::V1::DominantColorsAnnotation]
|
522
|
+
# If present, dominant colors completed successfully.
|
523
|
+
class ImageProperties
|
524
|
+
include Google::Protobuf::MessageExts
|
525
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
526
|
+
end
|
527
|
+
|
528
|
+
# Single crop hint that is used to generate a new crop when serving an image.
|
529
|
+
# @!attribute [rw] bounding_poly
|
530
|
+
# @return [Google::Cloud::Vision::V1::BoundingPoly]
|
531
|
+
# The bounding polygon for the crop region. The coordinates of the bounding
|
532
|
+
# box are in the original image's scale.
|
533
|
+
# @!attribute [rw] confidence
|
534
|
+
# @return [Float]
|
535
|
+
# Confidence of this being a salient region. Range [0, 1].
|
536
|
+
# @!attribute [rw] importance_fraction
|
537
|
+
# @return [Float]
|
538
|
+
# Fraction of importance of this salient region with respect to the original
|
539
|
+
# image.
|
540
|
+
class CropHint
|
541
|
+
include Google::Protobuf::MessageExts
|
542
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
543
|
+
end
|
544
|
+
|
545
|
+
# Set of crop hints that are used to generate new crops when serving images.
|
546
|
+
# @!attribute [rw] crop_hints
|
547
|
+
# @return [Array<Google::Cloud::Vision::V1::CropHint>]
|
548
|
+
# Crop hint results.
|
549
|
+
class CropHintsAnnotation
|
550
|
+
include Google::Protobuf::MessageExts
|
551
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
552
|
+
end
|
553
|
+
|
554
|
+
# Parameters for crop hints annotation request.
|
555
|
+
# @!attribute [rw] aspect_ratios
|
556
|
+
# @return [Array<Float>]
|
557
|
+
# Aspect ratios in floats, representing the ratio of the width to the height
|
558
|
+
# of the image. For example, if the desired aspect ratio is 4/3, the
|
559
|
+
# corresponding float value should be 1.33333. If not specified, the
|
560
|
+
# best possible crop is returned. The number of provided aspect ratios is
|
561
|
+
# limited to a maximum of 16; any aspect ratios provided after the 16th are
|
562
|
+
# ignored.
|
563
|
+
class CropHintsParams
|
564
|
+
include Google::Protobuf::MessageExts
|
565
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
566
|
+
end
|
567
|
+
|
568
|
+
# Parameters for web detection request.
|
569
|
+
# @!attribute [rw] include_geo_results
|
570
|
+
# @return [Boolean]
|
571
|
+
# Whether to include results derived from the geo information in the image.
|
572
|
+
class WebDetectionParams
|
573
|
+
include Google::Protobuf::MessageExts
|
574
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
575
|
+
end
|
576
|
+
|
577
|
+
# Image context and/or feature-specific parameters.
|
578
|
+
# @!attribute [rw] lat_long_rect
|
579
|
+
# @return [Google::Cloud::Vision::V1::LatLongRect]
|
580
|
+
# Not used.
|
581
|
+
# @!attribute [rw] language_hints
|
582
|
+
# @return [Array<String>]
|
583
|
+
# List of languages to use for TEXT_DETECTION. In most cases, an empty value
|
584
|
+
# yields the best results since it enables automatic language detection. For
|
585
|
+
# languages based on the Latin alphabet, setting `language_hints` is not
|
586
|
+
# needed. In rare cases, when the language of the text in the image is known,
|
587
|
+
# setting a hint will help get better results (although it will be a
|
588
|
+
# significant hindrance if the hint is wrong). Text detection returns an
|
589
|
+
# error if one or more of the specified languages is not one of the
|
590
|
+
# [supported languages](/vision/docs/languages).
|
591
|
+
# @!attribute [rw] crop_hints_params
|
592
|
+
# @return [Google::Cloud::Vision::V1::CropHintsParams]
|
593
|
+
# Parameters for crop hints annotation request.
|
594
|
+
# @!attribute [rw] product_search_params
|
595
|
+
# @return [Google::Cloud::Vision::V1::ProductSearchParams]
|
596
|
+
# Parameters for product search.
|
597
|
+
# @!attribute [rw] web_detection_params
|
598
|
+
# @return [Google::Cloud::Vision::V1::WebDetectionParams]
|
599
|
+
# Parameters for web detection.
|
600
|
+
class ImageContext
|
601
|
+
include Google::Protobuf::MessageExts
|
602
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
603
|
+
end
|
604
|
+
|
605
|
+
# Request for performing Google Cloud Vision API tasks over a user-provided
|
606
|
+
# image, with user-requested features, and with context information.
|
607
|
+
# @!attribute [rw] image
|
608
|
+
# @return [Google::Cloud::Vision::V1::Image]
|
609
|
+
# The image to be processed.
|
610
|
+
# @!attribute [rw] features
|
611
|
+
# @return [Array<Google::Cloud::Vision::V1::Feature>]
|
612
|
+
# Requested features.
|
613
|
+
# @!attribute [rw] image_context
|
614
|
+
# @return [Google::Cloud::Vision::V1::ImageContext]
|
615
|
+
# Additional context that may accompany the image.
|
616
|
+
class AnnotateImageRequest
|
617
|
+
include Google::Protobuf::MessageExts
|
618
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
619
|
+
end
|
620
|
+
|
621
|
+
# If an image was produced from a file (e.g. a PDF), this message gives
|
622
|
+
# information about the source of that image.
|
623
|
+
# @!attribute [rw] uri
|
624
|
+
# @return [String]
|
625
|
+
# The URI of the file used to produce the image.
|
626
|
+
# @!attribute [rw] page_number
|
627
|
+
# @return [Integer]
|
628
|
+
# If the file was a PDF or TIFF, this field gives the page number within
|
629
|
+
# the file used to produce the image.
|
630
|
+
class ImageAnnotationContext
|
631
|
+
include Google::Protobuf::MessageExts
|
632
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
633
|
+
end
|
634
|
+
|
635
|
+
# Response to an image annotation request.
|
636
|
+
# @!attribute [rw] face_annotations
|
637
|
+
# @return [Array<Google::Cloud::Vision::V1::FaceAnnotation>]
|
638
|
+
# If present, face detection has completed successfully.
|
639
|
+
# @!attribute [rw] landmark_annotations
|
640
|
+
# @return [Array<Google::Cloud::Vision::V1::EntityAnnotation>]
|
641
|
+
# If present, landmark detection has completed successfully.
|
642
|
+
# @!attribute [rw] logo_annotations
|
643
|
+
# @return [Array<Google::Cloud::Vision::V1::EntityAnnotation>]
|
644
|
+
# If present, logo detection has completed successfully.
|
645
|
+
# @!attribute [rw] label_annotations
|
646
|
+
# @return [Array<Google::Cloud::Vision::V1::EntityAnnotation>]
|
647
|
+
# If present, label detection has completed successfully.
|
648
|
+
# @!attribute [rw] localized_object_annotations
|
649
|
+
# @return [Array<Google::Cloud::Vision::V1::LocalizedObjectAnnotation>]
|
650
|
+
# If present, localized object detection has completed successfully.
|
651
|
+
# This will be sorted descending by confidence score.
|
652
|
+
# @!attribute [rw] text_annotations
|
653
|
+
# @return [Array<Google::Cloud::Vision::V1::EntityAnnotation>]
|
654
|
+
# If present, text (OCR) detection has completed successfully.
|
655
|
+
# @!attribute [rw] full_text_annotation
|
656
|
+
# @return [Google::Cloud::Vision::V1::TextAnnotation]
|
657
|
+
# If present, text (OCR) detection or document (OCR) text detection has
|
658
|
+
# completed successfully.
|
659
|
+
# This annotation provides the structural hierarchy for the OCR detected
|
660
|
+
# text.
|
661
|
+
# @!attribute [rw] safe_search_annotation
|
662
|
+
# @return [Google::Cloud::Vision::V1::SafeSearchAnnotation]
|
663
|
+
# If present, safe-search annotation has completed successfully.
|
664
|
+
# @!attribute [rw] image_properties_annotation
|
665
|
+
# @return [Google::Cloud::Vision::V1::ImageProperties]
|
666
|
+
# If present, image properties were extracted successfully.
|
667
|
+
# @!attribute [rw] crop_hints_annotation
|
668
|
+
# @return [Google::Cloud::Vision::V1::CropHintsAnnotation]
|
669
|
+
# If present, crop hints have completed successfully.
|
670
|
+
# @!attribute [rw] web_detection
|
671
|
+
# @return [Google::Cloud::Vision::V1::WebDetection]
|
672
|
+
# If present, web detection has completed successfully.
|
673
|
+
# @!attribute [rw] product_search_results
|
674
|
+
# @return [Google::Cloud::Vision::V1::ProductSearchResults]
|
675
|
+
# If present, product search has completed successfully.
|
676
|
+
# @!attribute [rw] error
|
677
|
+
# @return [Google::Rpc::Status]
|
678
|
+
# If set, represents the error message for the operation.
|
679
|
+
# Note that filled-in image annotations are guaranteed to be
|
680
|
+
# correct, even when `error` is set.
|
681
|
+
# @!attribute [rw] context
|
682
|
+
# @return [Google::Cloud::Vision::V1::ImageAnnotationContext]
|
683
|
+
# If present, contextual information is needed to understand where this image
|
684
|
+
# comes from.
|
685
|
+
class AnnotateImageResponse
|
686
|
+
include Google::Protobuf::MessageExts
|
687
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
688
|
+
end
|
689
|
+
|
690
|
+
# Multiple image annotation requests are batched into a single service call.
|
691
|
+
# @!attribute [rw] requests
|
692
|
+
# @return [Array<Google::Cloud::Vision::V1::AnnotateImageRequest>]
|
693
|
+
# Required. Individual image annotation requests for this batch.
|
694
|
+
# @!attribute [rw] parent
|
695
|
+
# @return [String]
|
696
|
+
# Optional. Target project and location to make a call.
|
697
|
+
#
|
698
|
+
# Format: `projects/{project-id}/locations/{location-id}`.
|
699
|
+
#
|
700
|
+
# If no parent is specified, a region will be chosen automatically.
|
701
|
+
#
|
702
|
+
# Supported location-ids:
|
703
|
+
# `us`: USA country only,
|
704
|
+
# `asia`: East asia areas, like Japan, Taiwan,
|
705
|
+
# `eu`: The European Union.
|
706
|
+
#
|
707
|
+
# Example: `projects/project-A/locations/eu`.
|
708
|
+
class BatchAnnotateImagesRequest
|
709
|
+
include Google::Protobuf::MessageExts
|
710
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
711
|
+
end
|
712
|
+
|
713
|
+
# Response to a batch image annotation request.
|
714
|
+
# @!attribute [rw] responses
|
715
|
+
# @return [Array<Google::Cloud::Vision::V1::AnnotateImageResponse>]
|
716
|
+
# Individual responses to image annotation requests within the batch.
|
717
|
+
class BatchAnnotateImagesResponse
|
718
|
+
include Google::Protobuf::MessageExts
|
719
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
720
|
+
end
|
721
|
+
|
722
|
+
# A request to annotate one single file, e.g. a PDF, TIFF or GIF file.
|
723
|
+
# @!attribute [rw] input_config
|
724
|
+
# @return [Google::Cloud::Vision::V1::InputConfig]
|
725
|
+
# Required. Information about the input file.
|
726
|
+
# @!attribute [rw] features
|
727
|
+
# @return [Array<Google::Cloud::Vision::V1::Feature>]
|
728
|
+
# Required. Requested features.
|
729
|
+
# @!attribute [rw] image_context
|
730
|
+
# @return [Google::Cloud::Vision::V1::ImageContext]
|
731
|
+
# Additional context that may accompany the image(s) in the file.
|
732
|
+
# @!attribute [rw] pages
|
733
|
+
# @return [Array<Integer>]
|
734
|
+
# Pages of the file to perform image annotation.
|
735
|
+
#
|
736
|
+
# Pages starts from 1, we assume the first page of the file is page 1.
|
737
|
+
# At most 5 pages are supported per request. Pages can be negative.
|
738
|
+
#
|
739
|
+
# Page 1 means the first page.
|
740
|
+
# Page 2 means the second page.
|
741
|
+
# Page -1 means the last page.
|
742
|
+
# Page -2 means the second to the last page.
|
743
|
+
#
|
744
|
+
# If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
|
745
|
+
#
|
746
|
+
# If this field is empty, by default the service performs image annotation
|
747
|
+
# for the first 5 pages of the file.
|
748
|
+
class AnnotateFileRequest
|
749
|
+
include Google::Protobuf::MessageExts
|
750
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
751
|
+
end
|
752
|
+
|
753
|
+
# Response to a single file annotation request. A file may contain one or more
|
754
|
+
# images, which individually have their own responses.
|
755
|
+
# @!attribute [rw] input_config
|
756
|
+
# @return [Google::Cloud::Vision::V1::InputConfig]
|
757
|
+
# Information about the file for which this response is generated.
|
758
|
+
# @!attribute [rw] responses
|
759
|
+
# @return [Array<Google::Cloud::Vision::V1::AnnotateImageResponse>]
|
760
|
+
# Individual responses to images found within the file. This field will be
|
761
|
+
# empty if the `error` field is set.
|
762
|
+
# @!attribute [rw] total_pages
|
763
|
+
# @return [Integer]
|
764
|
+
# This field gives the total number of pages in the file.
|
765
|
+
# @!attribute [rw] error
|
766
|
+
# @return [Google::Rpc::Status]
|
767
|
+
# If set, represents the error message for the failed request. The
|
768
|
+
# `responses` field will not be set in this case.
|
769
|
+
class AnnotateFileResponse
|
770
|
+
include Google::Protobuf::MessageExts
|
771
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
772
|
+
end
|
773
|
+
|
774
|
+
# A list of requests to annotate files using the BatchAnnotateFiles API.
|
775
|
+
# @!attribute [rw] requests
|
776
|
+
# @return [Array<Google::Cloud::Vision::V1::AnnotateFileRequest>]
|
777
|
+
# Required. The list of file annotation requests. Right now we support only one
|
778
|
+
# AnnotateFileRequest in BatchAnnotateFilesRequest.
|
779
|
+
# @!attribute [rw] parent
|
780
|
+
# @return [String]
|
781
|
+
# Optional. Target project and location to make a call.
|
782
|
+
#
|
783
|
+
# Format: `projects/{project-id}/locations/{location-id}`.
|
784
|
+
#
|
785
|
+
# If no parent is specified, a region will be chosen automatically.
|
786
|
+
#
|
787
|
+
# Supported location-ids:
|
788
|
+
# `us`: USA country only,
|
789
|
+
# `asia`: East asia areas, like Japan, Taiwan,
|
790
|
+
# `eu`: The European Union.
|
791
|
+
#
|
792
|
+
# Example: `projects/project-A/locations/eu`.
|
793
|
+
class BatchAnnotateFilesRequest
|
794
|
+
include Google::Protobuf::MessageExts
|
795
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
796
|
+
end
|
797
|
+
|
798
|
+
# A list of file annotation responses.
|
799
|
+
# @!attribute [rw] responses
|
800
|
+
# @return [Array<Google::Cloud::Vision::V1::AnnotateFileResponse>]
|
801
|
+
# The list of file annotation responses, each response corresponding to each
|
802
|
+
# AnnotateFileRequest in BatchAnnotateFilesRequest.
|
803
|
+
class BatchAnnotateFilesResponse
|
804
|
+
include Google::Protobuf::MessageExts
|
805
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
806
|
+
end
|
807
|
+
|
808
|
+
# An offline file annotation request.
|
809
|
+
# @!attribute [rw] input_config
|
810
|
+
# @return [Google::Cloud::Vision::V1::InputConfig]
|
811
|
+
# Required. Information about the input file.
|
812
|
+
# @!attribute [rw] features
|
813
|
+
# @return [Array<Google::Cloud::Vision::V1::Feature>]
|
814
|
+
# Required. Requested features.
|
815
|
+
# @!attribute [rw] image_context
|
816
|
+
# @return [Google::Cloud::Vision::V1::ImageContext]
|
817
|
+
# Additional context that may accompany the image(s) in the file.
|
818
|
+
# @!attribute [rw] output_config
|
819
|
+
# @return [Google::Cloud::Vision::V1::OutputConfig]
|
820
|
+
# Required. The desired output location and metadata (e.g. format).
|
821
|
+
class AsyncAnnotateFileRequest
|
822
|
+
include Google::Protobuf::MessageExts
|
823
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
824
|
+
end
|
825
|
+
|
826
|
+
# The response for a single offline file annotation request.
|
827
|
+
# @!attribute [rw] output_config
|
828
|
+
# @return [Google::Cloud::Vision::V1::OutputConfig]
|
829
|
+
# The output location and metadata from AsyncAnnotateFileRequest.
|
830
|
+
class AsyncAnnotateFileResponse
|
831
|
+
include Google::Protobuf::MessageExts
|
832
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
833
|
+
end
|
834
|
+
|
835
|
+
# Request for async image annotation for a list of images.
|
836
|
+
# @!attribute [rw] requests
|
837
|
+
# @return [Array<Google::Cloud::Vision::V1::AnnotateImageRequest>]
|
838
|
+
# Required. Individual image annotation requests for this batch.
|
839
|
+
# @!attribute [rw] output_config
|
840
|
+
# @return [Google::Cloud::Vision::V1::OutputConfig]
|
841
|
+
# Required. The desired output location and metadata (e.g. format).
|
842
|
+
# @!attribute [rw] parent
|
843
|
+
# @return [String]
|
844
|
+
# Optional. Target project and location to make a call.
|
845
|
+
#
|
846
|
+
# Format: `projects/{project-id}/locations/{location-id}`.
|
847
|
+
#
|
848
|
+
# If no parent is specified, a region will be chosen automatically.
|
849
|
+
#
|
850
|
+
# Supported location-ids:
|
851
|
+
# `us`: USA country only,
|
852
|
+
# `asia`: East asia areas, like Japan, Taiwan,
|
853
|
+
# `eu`: The European Union.
|
854
|
+
#
|
855
|
+
# Example: `projects/project-A/locations/eu`.
|
856
|
+
class AsyncBatchAnnotateImagesRequest
|
857
|
+
include Google::Protobuf::MessageExts
|
858
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
859
|
+
end
|
860
|
+
|
861
|
+
# Response to an async batch image annotation request.
|
862
|
+
# @!attribute [rw] output_config
|
863
|
+
# @return [Google::Cloud::Vision::V1::OutputConfig]
|
864
|
+
# The output location and metadata from AsyncBatchAnnotateImagesRequest.
|
865
|
+
class AsyncBatchAnnotateImagesResponse
|
866
|
+
include Google::Protobuf::MessageExts
|
867
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
868
|
+
end
|
869
|
+
|
870
|
+
# Multiple async file annotation requests are batched into a single service
|
871
|
+
# call.
|
872
|
+
# @!attribute [rw] requests
|
873
|
+
# @return [Array<Google::Cloud::Vision::V1::AsyncAnnotateFileRequest>]
|
874
|
+
# Required. Individual async file annotation requests for this batch.
|
875
|
+
# @!attribute [rw] parent
|
876
|
+
# @return [String]
|
877
|
+
# Optional. Target project and location to make a call.
|
878
|
+
#
|
879
|
+
# Format: `projects/{project-id}/locations/{location-id}`.
|
880
|
+
#
|
881
|
+
# If no parent is specified, a region will be chosen automatically.
|
882
|
+
#
|
883
|
+
# Supported location-ids:
|
884
|
+
# `us`: USA country only,
|
885
|
+
# `asia`: East asia areas, like Japan, Taiwan,
|
886
|
+
# `eu`: The European Union.
|
887
|
+
#
|
888
|
+
# Example: `projects/project-A/locations/eu`.
|
889
|
+
class AsyncBatchAnnotateFilesRequest
|
890
|
+
include Google::Protobuf::MessageExts
|
891
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
892
|
+
end
|
893
|
+
|
894
|
+
# Response to an async batch file annotation request.
|
895
|
+
# @!attribute [rw] responses
|
896
|
+
# @return [Array<Google::Cloud::Vision::V1::AsyncAnnotateFileResponse>]
|
897
|
+
# The list of file annotation responses, one for each request in
|
898
|
+
# AsyncBatchAnnotateFilesRequest.
|
899
|
+
class AsyncBatchAnnotateFilesResponse
|
900
|
+
include Google::Protobuf::MessageExts
|
901
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
902
|
+
end
|
903
|
+
|
904
|
+
# The desired input location and metadata.
|
905
|
+
# @!attribute [rw] gcs_source
|
906
|
+
# @return [Google::Cloud::Vision::V1::GcsSource]
|
907
|
+
# The Google Cloud Storage location to read the input from.
|
908
|
+
# @!attribute [rw] content
|
909
|
+
# @return [String]
|
910
|
+
# File content, represented as a stream of bytes.
|
911
|
+
# Note: As with all `bytes` fields, protobuffers use a pure binary
|
912
|
+
# representation, whereas JSON representations use base64.
|
913
|
+
#
|
914
|
+
# Currently, this field only works for BatchAnnotateFiles requests. It does
|
915
|
+
# not work for AsyncBatchAnnotateFiles requests.
|
916
|
+
# @!attribute [rw] mime_type
|
917
|
+
# @return [String]
|
918
|
+
# The type of the file. Currently only "application/pdf", "image/tiff" and
|
919
|
+
# "image/gif" are supported. Wildcards are not supported.
|
920
|
+
class InputConfig
|
921
|
+
include Google::Protobuf::MessageExts
|
922
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
923
|
+
end
|
924
|
+
|
925
|
+
# The desired output location and metadata.
|
926
|
+
# @!attribute [rw] gcs_destination
|
927
|
+
# @return [Google::Cloud::Vision::V1::GcsDestination]
|
928
|
+
# The Google Cloud Storage location to write the output(s) to.
|
929
|
+
# @!attribute [rw] batch_size
|
930
|
+
# @return [Integer]
|
931
|
+
# The max number of response protos to put into each output JSON file on
|
932
|
+
# Google Cloud Storage.
|
933
|
+
# The valid range is [1, 100]. If not specified, the default value is 20.
|
934
|
+
#
|
935
|
+
# For example, for one pdf file with 100 pages, 100 response protos will
|
936
|
+
# be generated. If `batch_size` = 20, then 5 json files each
|
937
|
+
# containing 20 response protos will be written under the prefix
|
938
|
+
# `gcs_destination`.`uri`.
|
939
|
+
#
|
940
|
+
# Currently, batch_size only applies to GcsDestination, with potential future
|
941
|
+
# support for other output configurations.
|
942
|
+
class OutputConfig
|
943
|
+
include Google::Protobuf::MessageExts
|
944
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
945
|
+
end
|
946
|
+
|
947
|
+
# The Google Cloud Storage location where the input will be read from.
|
948
|
+
# @!attribute [rw] uri
|
949
|
+
# @return [String]
|
950
|
+
# Google Cloud Storage URI for the input file. This must only be a
|
951
|
+
# Google Cloud Storage object. Wildcards are not currently supported.
|
952
|
+
class GcsSource
|
953
|
+
include Google::Protobuf::MessageExts
|
954
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
955
|
+
end
|
956
|
+
|
957
|
+
# The Google Cloud Storage location where the output will be written to.
|
958
|
+
# @!attribute [rw] uri
|
959
|
+
# @return [String]
|
960
|
+
# Google Cloud Storage URI prefix where the results will be stored. Results
|
961
|
+
# will be in JSON format and preceded by its corresponding input URI prefix.
|
962
|
+
# This field can either represent a gcs file prefix or gcs directory. In
|
963
|
+
# either case, the uri should be unique because in order to get all of the
|
964
|
+
# output files, you will need to do a wildcard gcs search on the uri prefix
|
965
|
+
# you provide.
|
966
|
+
#
|
967
|
+
# Examples:
|
968
|
+
#
|
969
|
+
# * File Prefix: gs://bucket-name/here/filenameprefix The output files
|
970
|
+
# will be created in gs://bucket-name/here/ and the names of the
|
971
|
+
# output files will begin with "filenameprefix".
|
972
|
+
#
|
973
|
+
# * Directory Prefix: gs://bucket-name/some/location/ The output files
|
974
|
+
# will be created in gs://bucket-name/some/location/ and the names of the
|
975
|
+
# output files could be anything because there was no filename prefix
|
976
|
+
# specified.
|
977
|
+
#
|
978
|
+
# If multiple outputs, each response is still AnnotateFileResponse, each of
|
979
|
+
# which contains some subset of the full list of AnnotateImageResponse.
|
980
|
+
# Multiple outputs can happen if, for example, the output JSON is too large
|
981
|
+
# and overflows into multiple sharded files.
|
982
|
+
class GcsDestination
|
983
|
+
include Google::Protobuf::MessageExts
|
984
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
985
|
+
end
|
986
|
+
|
987
|
+
# Contains metadata for the BatchAnnotateImages operation.
|
988
|
+
# @!attribute [rw] state
|
989
|
+
# @return [Google::Cloud::Vision::V1::OperationMetadata::State]
|
990
|
+
# Current state of the batch operation.
|
991
|
+
# @!attribute [rw] create_time
|
992
|
+
# @return [Google::Protobuf::Timestamp]
|
993
|
+
# The time when the batch request was received.
|
994
|
+
# @!attribute [rw] update_time
|
995
|
+
# @return [Google::Protobuf::Timestamp]
|
996
|
+
# The time when the operation result was last updated.
|
997
|
+
class OperationMetadata
|
998
|
+
include Google::Protobuf::MessageExts
|
999
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
1000
|
+
|
1001
|
+
# Batch operation states.
|
1002
|
+
module State
|
1003
|
+
# Invalid.
|
1004
|
+
STATE_UNSPECIFIED = 0
|
1005
|
+
|
1006
|
+
# Request is received.
|
1007
|
+
CREATED = 1
|
1008
|
+
|
1009
|
+
# Request is actively being processed.
|
1010
|
+
RUNNING = 2
|
1011
|
+
|
1012
|
+
# The batch processing is done.
|
1013
|
+
DONE = 3
|
1014
|
+
|
1015
|
+
# The batch processing was cancelled.
|
1016
|
+
CANCELLED = 4
|
1017
|
+
end
|
1018
|
+
end
|
1019
|
+
|
1020
|
+
# A bucketized representation of likelihood, which is intended to give clients
|
1021
|
+
# highly stable results across model upgrades.
|
1022
|
+
module Likelihood
|
1023
|
+
# Unknown likelihood.
|
1024
|
+
UNKNOWN = 0
|
1025
|
+
|
1026
|
+
# It is very unlikely.
|
1027
|
+
VERY_UNLIKELY = 1
|
1028
|
+
|
1029
|
+
# It is unlikely.
|
1030
|
+
UNLIKELY = 2
|
1031
|
+
|
1032
|
+
# It is possible.
|
1033
|
+
POSSIBLE = 3
|
1034
|
+
|
1035
|
+
# It is likely.
|
1036
|
+
LIKELY = 4
|
1037
|
+
|
1038
|
+
# It is very likely.
|
1039
|
+
VERY_LIKELY = 5
|
1040
|
+
end
|
1041
|
+
end
|
1042
|
+
end
|
1043
|
+
end
|
1044
|
+
end
|