google-cloud-vision 0.30.1 → 0.30.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +9 -1
- data/README.md +22 -12
- data/lib/google-cloud-vision.rb +1 -0
- data/lib/google/cloud/vision.rb +1 -222
- data/lib/google/cloud/vision/v1.rb +6 -0
- data/lib/google/cloud/vision/v1/credentials.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/geometry.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/image_annotator.rb +28 -0
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/web_detection.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/longrunning/operations.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/protobuf/any.rb +14 -8
- data/lib/google/cloud/vision/v1/doc/google/protobuf/wrappers.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/rpc/status.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/type/color.rb +1 -0
- data/lib/google/cloud/vision/v1/doc/google/type/latlng.rb +1 -0
- data/lib/google/cloud/vision/v1/geometry_pb.rb +1 -0
- data/lib/google/cloud/vision/v1/image_annotator_client.rb +2 -0
- data/lib/google/cloud/vision/v1/image_annotator_pb.rb +11 -0
- data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +1 -0
- data/lib/google/cloud/vision/v1/text_annotation_pb.rb +1 -0
- data/lib/google/cloud/vision/v1/web_detection_pb.rb +1 -0
- data/lib/google/cloud/vision/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82f7659d17511a5614ad7fef9c50659494515606830bd8b7872e243c4f253bec
|
4
|
+
data.tar.gz: ef0fcfe19887df1051ba3fb06ed1e74ecdee3cb94cc947cb7f4057a2cfdc6154
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0192759e5ef273badc8220ce1cb2195351b09f624417dd3bf1947db46257075c844603448b50bc4bd6b0652d0cf1e6b8ea0d125b952a497b94f2103af4a630f4'
|
7
|
+
data.tar.gz: 7ce13c76100395e42e3681a5adbe299f279cfe08287f553827ef94427ed75e62ab246b6923ed1ae8b25f188759b7f7394d9006c1b87346eaf718f54d8d6b64bd
|
data/.yardopts
CHANGED
@@ -3,7 +3,15 @@
|
|
3
3
|
--exclude _pb\.rb$
|
4
4
|
--markup markdown
|
5
5
|
--markup-provider redcarpet
|
6
|
+
--main OVERVIEW.md
|
6
7
|
|
7
8
|
./lib/**/*.rb
|
8
9
|
-
|
9
|
-
|
10
|
+
OVERVIEW.md
|
11
|
+
AUTHENTICATION.md
|
12
|
+
LOGGING.md
|
13
|
+
CONTRIBUTING.md
|
14
|
+
TROUBLESHOOTING.md
|
15
|
+
CHANGELOG.md
|
16
|
+
CODE_OF_CONDUCT.md
|
17
|
+
LICENSE
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[Google Cloud Vision](https://cloud.google.com/vision/) ([docs](https://cloud.google.com/vision/docs)) allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.
|
4
4
|
|
5
|
-
- [google-cloud-vision API documentation](http://googlecloudplatform.github.io/google-cloud-ruby
|
5
|
+
- [google-cloud-vision API documentation](http://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-vision/latest)
|
6
6
|
- [google-cloud-vision on RubyGems](https://rubygems.org/gems/google-cloud-vision)
|
7
7
|
- [Google Cloud Vision documentation](https://cloud.google.com/vision/docs)
|
8
8
|
|
@@ -16,7 +16,7 @@ $ gem install google-cloud-vision
|
|
16
16
|
|
17
17
|
This library uses Service Account credentials to connect to Google Cloud services. When running on Compute Engine the credentials will be discovered automatically. When running on other environments the Service Account credentials can be specified by providing the path to the JSON file, or the JSON itself, in environment variables.
|
18
18
|
|
19
|
-
Instructions and configuration options are covered in the [Authentication Guide](https://googlecloudplatform.github.io/google-cloud-ruby
|
19
|
+
Instructions and configuration options are covered in the [Authentication Guide](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-vision/latest/file.AUTHENTICATION).
|
20
20
|
|
21
21
|
## Example
|
22
22
|
|
@@ -33,7 +33,7 @@ landmark.description #=> "Mount Rushmore"
|
|
33
33
|
|
34
34
|
## Enabling Logging
|
35
35
|
|
36
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby
|
36
|
+
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-logging/latest/Google/Cloud/Logging/Logger) that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
37
37
|
|
38
38
|
Configuring a Ruby stdlib logger:
|
39
39
|
|
@@ -58,9 +58,9 @@ end
|
|
58
58
|
This library is supported on Ruby 2.3+.
|
59
59
|
|
60
60
|
Google provides official support for Ruby versions that are actively supported
|
61
|
-
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
62
|
-
|
63
|
-
|
61
|
+
by Ruby Core—that is, Ruby versions that are either in normal maintenance or in
|
62
|
+
security maintenance, and not end of life. Currently, this means Ruby 2.3 and
|
63
|
+
later. Older versions of Ruby _may_ still work, but are unsupported and not
|
64
64
|
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
65
65
|
about the Ruby support schedule.
|
66
66
|
|
@@ -68,21 +68,31 @@ about the Ruby support schedule.
|
|
68
68
|
|
69
69
|
This library follows [Semantic Versioning](http://semver.org/).
|
70
70
|
|
71
|
-
It is currently in major version zero (0.y.z), which means that anything may
|
71
|
+
It is currently in major version zero (0.y.z), which means that anything may
|
72
|
+
change at any time and the public API should not be considered stable.
|
72
73
|
|
73
74
|
## Contributing
|
74
75
|
|
75
76
|
Contributions to this library are always welcome and highly encouraged.
|
76
77
|
|
77
|
-
See the [Contributing
|
78
|
+
See the [Contributing
|
79
|
+
Guide](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-vision/latest/file.CONTRIBUTING)
|
80
|
+
for more information on how to get started.
|
78
81
|
|
79
|
-
Please note that this project is released with a Contributor Code of Conduct. By
|
82
|
+
Please note that this project is released with a Contributor Code of Conduct. By
|
83
|
+
participating in this project you agree to abide by its terms. See [Code of
|
84
|
+
Conduct](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-vision/latest/file.CODE_OF_CONDUCT)
|
85
|
+
for more information.
|
80
86
|
|
81
87
|
## License
|
82
88
|
|
83
|
-
This library is licensed under Apache 2.0. Full license text is available in
|
89
|
+
This library is licensed under Apache 2.0. Full license text is available in
|
90
|
+
[LICENSE](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-vision/latest/file.LICENSE).
|
84
91
|
|
85
92
|
## Support
|
86
93
|
|
87
|
-
Please [report bugs at the project on
|
88
|
-
|
94
|
+
Please [report bugs at the project on
|
95
|
+
Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues). Don't
|
96
|
+
hesitate to [ask
|
97
|
+
questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby)
|
98
|
+
about the client or APIs on [StackOverflow](http://stackoverflow.com).
|
data/lib/google-cloud-vision.rb
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
##
|
16
17
|
# This file is here to be autorequired by bundler, so that the
|
17
18
|
# Google::Cloud.vision and Google::Cloud#vision methods can be available, but
|
data/lib/google/cloud/vision.rb
CHANGED
@@ -31,228 +31,7 @@ module Google
|
|
31
31
|
# For more information about Cloud Vision, read the [Google Cloud Vision API
|
32
32
|
# Documentation](https://cloud.google.com/vision/docs/).
|
33
33
|
#
|
34
|
-
#
|
35
|
-
# Rubyists. Your authentication credentials are detected automatically in
|
36
|
-
# Google Cloud Platform environments such as Google Compute Engine, Google
|
37
|
-
# App Engine and Google Kubernetes Engine. In other environments you can
|
38
|
-
# configure authentication easily, either directly in your code or via
|
39
|
-
# environment variables. Read more about the options for connecting in the
|
40
|
-
# [Authentication
|
41
|
-
# Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/authentication).
|
42
|
-
#
|
43
|
-
# ## Enabling Logging
|
44
|
-
#
|
45
|
-
# To enable logging for this library, set the logger for the underlying
|
46
|
-
# [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The
|
47
|
-
# logger that you set may be a Ruby stdlib
|
48
|
-
# [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html)
|
49
|
-
# as shown below, or a
|
50
|
-
# [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
|
51
|
-
# that will write logs to [Stackdriver
|
52
|
-
# Logging](https://cloud.google.com/logging/). See
|
53
|
-
# [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
54
|
-
# and the gRPC
|
55
|
-
# [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)
|
56
|
-
# for additional information.
|
57
|
-
#
|
58
|
-
# Configuring a Ruby stdlib logger:
|
59
|
-
#
|
60
|
-
# ```ruby
|
61
|
-
# require "logger"
|
62
|
-
#
|
63
|
-
# module MyLogger
|
64
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
65
|
-
# def logger
|
66
|
-
# LOGGER
|
67
|
-
# end
|
68
|
-
# end
|
69
|
-
#
|
70
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
71
|
-
# module GRPC
|
72
|
-
# extend MyLogger
|
73
|
-
# end
|
74
|
-
# ```
|
75
|
-
#
|
76
|
-
# ## Creating images
|
77
|
-
#
|
78
|
-
# The Cloud Vision API supports UTF-8, UTF-16, and UTF-32 text encodings.
|
79
|
-
# (Ruby uses UTF-8 natively, which is the default sent to the API, so unless
|
80
|
-
# you're working with text processed in different platform, you should not
|
81
|
-
# need to set the encoding type.)
|
82
|
-
# a ). Be aware that Cloud Vision sets upper
|
83
|
-
# limits on file size as well as on the total combined size of all images in
|
84
|
-
# a request. Reducing your file size can significantly improve throughput;
|
85
|
-
# however, be careful not to reduce image quality in the process. See [Best
|
86
|
-
# Practices - Image
|
87
|
-
# Sizing](https://cloud.google.com/vision/docs/best-practices#image_sizing)
|
88
|
-
# for current file size limits.
|
89
|
-
#
|
90
|
-
# Use {Vision::Project#image} to create images for the Cloud Vision service.
|
91
|
-
# You can provide a file path:
|
92
|
-
#
|
93
|
-
# ```ruby
|
94
|
-
# require "google/cloud/vision"
|
95
|
-
#
|
96
|
-
# vision = Google::Cloud::Vision.new
|
97
|
-
#
|
98
|
-
# image = vision.image "path/to/landmark.jpg"
|
99
|
-
# ```
|
100
|
-
#
|
101
|
-
# Or any publicly-accessible image HTTP/HTTPS URL:
|
102
|
-
#
|
103
|
-
# ```ruby
|
104
|
-
# require "google/cloud/vision"
|
105
|
-
#
|
106
|
-
# vision = Google::Cloud::Vision.new
|
107
|
-
#
|
108
|
-
# image = vision.image "https://www.example.com/images/landmark.jpg"
|
109
|
-
# ```
|
110
|
-
#
|
111
|
-
# Or, you can initialize the image with a Google Cloud Storage URI:
|
112
|
-
#
|
113
|
-
# ```ruby
|
114
|
-
# require "google/cloud/vision"
|
115
|
-
#
|
116
|
-
# vision = Google::Cloud::Vision.new
|
117
|
-
#
|
118
|
-
# image = vision.image "gs://bucket-name/path_to_image_object"
|
119
|
-
# ```
|
120
|
-
#
|
121
|
-
# Creating an Image instance does not perform an API request.
|
122
|
-
#
|
123
|
-
# ## Annotating images
|
124
|
-
#
|
125
|
-
# The instance methods on {Vision::Image} invoke Cloud Vision's detection
|
126
|
-
# features individually. Each method call makes an API request. (If you want
|
127
|
-
# to run multiple features in a single request, see the examples for
|
128
|
-
# {Vision::Project#annotate}, below.)
|
129
|
-
#
|
130
|
-
# ```ruby
|
131
|
-
# require "google/cloud/vision"
|
132
|
-
#
|
133
|
-
# vision = Google::Cloud::Vision.new
|
134
|
-
#
|
135
|
-
# image = vision.image "path/to/face.jpg"
|
136
|
-
#
|
137
|
-
# face = image.face
|
138
|
-
#
|
139
|
-
# face.features.to_h.count #=> 9
|
140
|
-
# face.features.eyes.left.pupil
|
141
|
-
# #<Landmark (x: 190.41544, y: 84.4557, z: -1.3682901)>
|
142
|
-
# face.features.chin.center
|
143
|
-
# #<Landmark (x: 233.21977, y: 189.47475, z: 19.487228)>
|
144
|
-
# ```
|
145
|
-
#
|
146
|
-
# To run multiple features on an image in a single request, pass the image
|
147
|
-
# (or a string file path, publicly-accessible image HTTP/HTTPS URL, or
|
148
|
-
# Storage URI) to {Vision::Project#annotate}:
|
149
|
-
#
|
150
|
-
# ```ruby
|
151
|
-
# require "google/cloud/vision"
|
152
|
-
#
|
153
|
-
# vision = Google::Cloud::Vision.new
|
154
|
-
#
|
155
|
-
# image = vision.image "path/to/face.jpg"
|
156
|
-
#
|
157
|
-
# annotation = vision.annotate image, faces: true, labels: true
|
158
|
-
# annotation.faces.count #=> 1
|
159
|
-
# annotation.labels.count #=> 4
|
160
|
-
# ```
|
161
|
-
#
|
162
|
-
# You can also perform detection tasks on multiple images in a single
|
163
|
-
# request:
|
164
|
-
#
|
165
|
-
# ```ruby
|
166
|
-
# require "google/cloud/vision"
|
167
|
-
#
|
168
|
-
# vision = Google::Cloud::Vision.new
|
169
|
-
#
|
170
|
-
# face_image = vision.image "path/to/face.jpg"
|
171
|
-
# landmark_image = vision.image "path/to/landmark.jpg"
|
172
|
-
#
|
173
|
-
# annotations = vision.annotate face_image,
|
174
|
-
# landmark_image,
|
175
|
-
# faces: true,
|
176
|
-
# landmarks: true,
|
177
|
-
# labels: true
|
178
|
-
#
|
179
|
-
# annotations[0].faces.count #=> 1
|
180
|
-
# annotations[0].landmarks.count #=> 0
|
181
|
-
# annotations[0].labels.count #=> 4
|
182
|
-
# annotations[1].faces.count #=> 1
|
183
|
-
# annotations[1].landmarks.count #=> 1
|
184
|
-
# annotations[1].labels.count #=> 6
|
185
|
-
# ```
|
186
|
-
#
|
187
|
-
# It is even possible to configure different features for multiple images in
|
188
|
-
# a single call using a block. The following example results in a single
|
189
|
-
# request to the Cloud Vision API:
|
190
|
-
#
|
191
|
-
# ```ruby
|
192
|
-
# require "google/cloud/vision"
|
193
|
-
#
|
194
|
-
# vision = Google::Cloud::Vision.new
|
195
|
-
#
|
196
|
-
# face_image = vision.image "path/to/face.jpg"
|
197
|
-
# landmark_image = vision.image "path/to/landmark.jpg"
|
198
|
-
# text_image = vision.image "path/to/text.png"
|
199
|
-
#
|
200
|
-
# annotations = vision.annotate do |annotate|
|
201
|
-
# annotate.annotate face_image, faces: true, labels: true
|
202
|
-
# annotate.annotate landmark_image, landmarks: true
|
203
|
-
# annotate.annotate text_image, text: true
|
204
|
-
# end
|
205
|
-
#
|
206
|
-
# annotations[0].faces.count #=> 1
|
207
|
-
# annotations[0].labels.count #=> 4
|
208
|
-
# annotations[1].landmarks.count #=> 1
|
209
|
-
# annotations[2].text.pages.count #=> 1
|
210
|
-
# ```
|
211
|
-
#
|
212
|
-
# The maximum number of results returned when performing face, landmark,
|
213
|
-
# logo, and label detection are defined by
|
214
|
-
# {Google::Cloud::Vision.default_max_faces},
|
215
|
-
# {Google::Cloud::Vision.default_max_landmarks},
|
216
|
-
# {Google::Cloud::Vision.default_max_logos}, and
|
217
|
-
# {Google::Cloud::Vision.default_max_labels}, respectively. To change the
|
218
|
-
# global defaults, you can update the configuration:
|
219
|
-
#
|
220
|
-
# ```ruby
|
221
|
-
# require "google/cloud/vision"
|
222
|
-
#
|
223
|
-
# vision = Google::Cloud::Vision.new
|
224
|
-
#
|
225
|
-
# Google::Cloud::Vision.default_max_faces = 1
|
226
|
-
#
|
227
|
-
# annotation = vision.annotate "path/to/face.jpg", faces: true
|
228
|
-
# annotation.faces.count #=> 1
|
229
|
-
# ```
|
230
|
-
#
|
231
|
-
# Or, to override a default for a single method call, simply pass an
|
232
|
-
# integer instead of a flag:
|
233
|
-
#
|
234
|
-
# ```ruby
|
235
|
-
# require "google/cloud/vision"
|
236
|
-
#
|
237
|
-
# vision = Google::Cloud::Vision.new
|
238
|
-
#
|
239
|
-
# image = vision.image "path/to/face.jpg"
|
240
|
-
#
|
241
|
-
# # Return just one face.
|
242
|
-
# annotation = vision.annotate image, faces: 1
|
243
|
-
# # Return up to 5 faces.
|
244
|
-
# annotation = vision.annotate image, faces: 5
|
245
|
-
# ```
|
246
|
-
#
|
247
|
-
# ## Configuring timeout
|
248
|
-
#
|
249
|
-
# You can configure the request `timeout` value in seconds.
|
250
|
-
#
|
251
|
-
# ```ruby
|
252
|
-
# require "google/cloud/vision"
|
253
|
-
#
|
254
|
-
# vision = Google::Cloud::Vision.new timeout: 120
|
255
|
-
# ```
|
34
|
+
# See {file:OVERVIEW.md Vision Overview}.
|
256
35
|
#
|
257
36
|
module Vision
|
258
37
|
class << self
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
require "google/cloud/vision/v1/image_annotator_client"
|
16
17
|
require "google/cloud/vision/v1/image_annotator_pb"
|
17
18
|
|
@@ -38,6 +39,11 @@ module Google
|
|
38
39
|
# 3. [Enable the Cloud Vision API.](https://console.cloud.google.com/apis/library/vision.googleapis.com)
|
39
40
|
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
40
41
|
#
|
42
|
+
# ### Installation
|
43
|
+
# ```
|
44
|
+
# $ gem install google-cloud-vision
|
45
|
+
# ```
|
46
|
+
#
|
41
47
|
# ### Preview
|
42
48
|
# #### ImageAnnotatorClient
|
43
49
|
# ```rb
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
module Google
|
16
17
|
module Cloud
|
17
18
|
module Vision
|
@@ -71,6 +72,9 @@ module Google
|
|
71
72
|
|
72
73
|
# Run web detection.
|
73
74
|
WEB_DETECTION = 10
|
75
|
+
|
76
|
+
# Run localizer for object detection.
|
77
|
+
OBJECT_LOCALIZATION = 19
|
74
78
|
end
|
75
79
|
end
|
76
80
|
|
@@ -366,6 +370,26 @@ module Google
|
|
366
370
|
# fields, such a score or string that qualifies the entity.
|
367
371
|
class EntityAnnotation; end
|
368
372
|
|
373
|
+
# Set of detected objects with bounding boxes.
|
374
|
+
# @!attribute [rw] mid
|
375
|
+
# @return [String]
|
376
|
+
# Object ID that should align with EntityAnnotation mid.
|
377
|
+
# @!attribute [rw] language_code
|
378
|
+
# @return [String]
|
379
|
+
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
380
|
+
# information, see
|
381
|
+
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
382
|
+
# @!attribute [rw] name
|
383
|
+
# @return [String]
|
384
|
+
# Object name, expressed in its +language_code+ language.
|
385
|
+
# @!attribute [rw] score
|
386
|
+
# @return [Float]
|
387
|
+
# Score of the result. Range [0, 1].
|
388
|
+
# @!attribute [rw] bounding_poly
|
389
|
+
# @return [Google::Cloud::Vision::V1::BoundingPoly]
|
390
|
+
# Image region to which this object belongs. This must be populated.
|
391
|
+
class LocalizedObjectAnnotation; end
|
392
|
+
|
369
393
|
# Set of features pertaining to the image, computed by computer vision
|
370
394
|
# methods over safe-search verticals (for example, adult, spoof, medical,
|
371
395
|
# violence).
|
@@ -524,6 +548,10 @@ module Google
|
|
524
548
|
# @!attribute [rw] label_annotations
|
525
549
|
# @return [Array<Google::Cloud::Vision::V1::EntityAnnotation>]
|
526
550
|
# If present, label detection has completed successfully.
|
551
|
+
# @!attribute [rw] localized_object_annotations
|
552
|
+
# @return [Array<Google::Cloud::Vision::V1::LocalizedObjectAnnotation>]
|
553
|
+
# If present, localized object detection has completed successfully.
|
554
|
+
# This will be sorted descending by confidence score.
|
527
555
|
# @!attribute [rw] text_annotations
|
528
556
|
# @return [Array<Google::Cloud::Vision::V1::EntityAnnotation>]
|
529
557
|
# If present, text (OCR) detection has completed successfully.
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
module Google
|
16
17
|
module Protobuf
|
17
18
|
# +Any+ contains an arbitrary serialized protocol buffer message along with a
|
@@ -95,17 +96,18 @@ module Google
|
|
95
96
|
# }
|
96
97
|
# @!attribute [rw] type_url
|
97
98
|
# @return [String]
|
98
|
-
# A URL/resource name
|
99
|
-
#
|
99
|
+
# A URL/resource name that uniquely identifies the type of the serialized
|
100
|
+
# protocol buffer message. The last segment of the URL's path must represent
|
101
|
+
# the fully qualified name of the type (as in
|
102
|
+
# +path/google.protobuf.Duration+). The name should be in a canonical form
|
103
|
+
# (e.g., leading "." is not accepted).
|
100
104
|
#
|
101
|
-
#
|
102
|
-
#
|
105
|
+
# In practice, teams usually precompile into the binary all types that they
|
106
|
+
# expect it to use in the context of Any. However, for URLs which use the
|
107
|
+
# scheme +http+, +https+, or no scheme, one can optionally set up a type
|
108
|
+
# server that maps type URLs to message definitions as follows:
|
103
109
|
#
|
104
110
|
# * If no scheme is provided, +https+ is assumed.
|
105
|
-
# * The last segment of the URL's path must represent the fully
|
106
|
-
# qualified name of the type (as in +path/google.protobuf.Duration+).
|
107
|
-
# The name should be in a canonical form (e.g., leading "." is
|
108
|
-
# not accepted).
|
109
111
|
# * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
|
110
112
|
# value in binary format, or produce an error.
|
111
113
|
# * Applications are allowed to cache lookup results based on the
|
@@ -114,6 +116,10 @@ module Google
|
|
114
116
|
# on changes to types. (Use versioned type names to manage
|
115
117
|
# breaking changes.)
|
116
118
|
#
|
119
|
+
# Note: this functionality is not currently available in the official
|
120
|
+
# protobuf release, and it is not used for type URLs beginning with
|
121
|
+
# type.googleapis.com.
|
122
|
+
#
|
117
123
|
# Schemes other than +http+, +https+ (or the empty scheme) might be
|
118
124
|
# used with implementation specific semantics.
|
119
125
|
# @!attribute [rw] value
|
@@ -19,6 +19,7 @@
|
|
19
19
|
# For the short term, the refresh process will only be runnable by Google
|
20
20
|
# engineers.
|
21
21
|
|
22
|
+
|
22
23
|
require "json"
|
23
24
|
require "pathname"
|
24
25
|
|
@@ -40,6 +41,7 @@ module Google
|
|
40
41
|
# @!attribute [r] image_annotator_stub
|
41
42
|
# @return [Google::Cloud::Vision::V1::ImageAnnotator::Stub]
|
42
43
|
class ImageAnnotatorClient
|
44
|
+
# @private
|
43
45
|
attr_reader :image_annotator_stub
|
44
46
|
|
45
47
|
# The default address of the service.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/vision/v1/image_annotator.proto
|
3
3
|
|
4
|
+
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
7
|
require 'google/api/annotations_pb'
|
@@ -30,6 +31,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
30
31
|
value :IMAGE_PROPERTIES, 7
|
31
32
|
value :CROP_HINTS, 9
|
32
33
|
value :WEB_DETECTION, 10
|
34
|
+
value :OBJECT_LOCALIZATION, 19
|
33
35
|
end
|
34
36
|
add_message "google.cloud.vision.v1.ImageSource" do
|
35
37
|
optional :gcs_image_uri, :string, 1
|
@@ -116,6 +118,13 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
116
118
|
repeated :locations, :message, 8, "google.cloud.vision.v1.LocationInfo"
|
117
119
|
repeated :properties, :message, 9, "google.cloud.vision.v1.Property"
|
118
120
|
end
|
121
|
+
add_message "google.cloud.vision.v1.LocalizedObjectAnnotation" do
|
122
|
+
optional :mid, :string, 1
|
123
|
+
optional :language_code, :string, 2
|
124
|
+
optional :name, :string, 3
|
125
|
+
optional :score, :float, 4
|
126
|
+
optional :bounding_poly, :message, 5, "google.cloud.vision.v1.BoundingPoly"
|
127
|
+
end
|
119
128
|
add_message "google.cloud.vision.v1.SafeSearchAnnotation" do
|
120
129
|
optional :adult, :enum, 1, "google.cloud.vision.v1.Likelihood"
|
121
130
|
optional :spoof, :enum, 2, "google.cloud.vision.v1.Likelihood"
|
@@ -172,6 +181,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
172
181
|
repeated :landmark_annotations, :message, 2, "google.cloud.vision.v1.EntityAnnotation"
|
173
182
|
repeated :logo_annotations, :message, 3, "google.cloud.vision.v1.EntityAnnotation"
|
174
183
|
repeated :label_annotations, :message, 4, "google.cloud.vision.v1.EntityAnnotation"
|
184
|
+
repeated :localized_object_annotations, :message, 22, "google.cloud.vision.v1.LocalizedObjectAnnotation"
|
175
185
|
repeated :text_annotations, :message, 5, "google.cloud.vision.v1.EntityAnnotation"
|
176
186
|
optional :full_text_annotation, :message, 12, "google.cloud.vision.v1.TextAnnotation"
|
177
187
|
optional :safe_search_annotation, :message, 6, "google.cloud.vision.v1.SafeSearchAnnotation"
|
@@ -256,6 +266,7 @@ module Google
|
|
256
266
|
LocationInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.LocationInfo").msgclass
|
257
267
|
Property = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.Property").msgclass
|
258
268
|
EntityAnnotation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.EntityAnnotation").msgclass
|
269
|
+
LocalizedObjectAnnotation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.LocalizedObjectAnnotation").msgclass
|
259
270
|
SafeSearchAnnotation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.SafeSearchAnnotation").msgclass
|
260
271
|
LatLongRect = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.LatLongRect").msgclass
|
261
272
|
ColorInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ColorInfo").msgclass
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-vision
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.30.
|
4
|
+
version: 0.30.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -169,16 +169,16 @@ dependencies:
|
|
169
169
|
name: yard-doctest
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
|
-
- - "
|
172
|
+
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: 0.1.
|
174
|
+
version: 0.1.13
|
175
175
|
type: :development
|
176
176
|
prerelease: false
|
177
177
|
version_requirements: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
|
-
- - "
|
179
|
+
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: 0.1.
|
181
|
+
version: 0.1.13
|
182
182
|
description: google-cloud-vision is the official library for Google Cloud Vision API.
|
183
183
|
email:
|
184
184
|
- mike@blowmage.com
|