google-cloud-vision 0.30.0 → 0.30.1
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 +4 -4
- data/.yardopts +2 -1
- data/lib/google/cloud/vision/project.rb +5 -2
- data/lib/google/cloud/vision/v1.rb +71 -71
- data/lib/google/cloud/vision/v1/credentials.rb +10 -2
- data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/image_annotator.rb +0 -11
- data/lib/google/cloud/vision/v1/image_annotator_client.rb +1 -0
- data/lib/google/cloud/vision/version.rb +1 -1
- metadata +16 -3
- data/lib/google/cloud/vision/v1/doc/overview.rb +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 309389c5af73e576ebc8d23625a6b719e0d0f950830b84658996a79a6d507a8f
|
4
|
+
data.tar.gz: 47eeebf655efa37923409e80b8ac9fce8e1b747ee8709b24ca30d38de49faa65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e63e6cd260f4764ffd3a487c742349d8a749d8ec244802d779b1c4fed6d1ae5c689e59ec5cf107daed8ad21cf4ebbebb0a2d2b071b2cf0e002e08d74fbbc2615
|
7
|
+
data.tar.gz: 16bb6ac645bf3413f555fa41360bcd4b323698cd1a9b830c6b7f3cdd21adaeb50025d0c28f8bf9a0c5c0e6f9a64a295660655d89d490d48c770b4ccaa976731d
|
data/.yardopts
CHANGED
@@ -275,6 +275,8 @@ module Google
|
|
275
275
|
annotations
|
276
276
|
end
|
277
277
|
|
278
|
+
# rubocop:disable LineLength
|
279
|
+
|
278
280
|
##
|
279
281
|
# Run asynchronous image detection and annotation for a list of generic
|
280
282
|
# files, such as PDF files, which may contain multiple pages and
|
@@ -284,8 +286,7 @@ module Google
|
|
284
286
|
# Operation.response contains AsyncBatchAnnotateFilesResponse
|
285
287
|
# (results).
|
286
288
|
#
|
287
|
-
# @param requests
|
288
|
-
# [Array<Google::Cloud::Vision::V1::AsyncAnnotateFileRequest | Hash>]
|
289
|
+
# @param requests [Array<Google::Cloud::Vision::V1::AsyncAnnotateFileRequest|Hash>]
|
289
290
|
# Individual async file annotation requests for this batch.
|
290
291
|
# A hash of the same form as
|
291
292
|
# `Google::Cloud::Vision::V1::AsyncAnnotateFileRequest` can also be
|
@@ -345,6 +346,8 @@ module Google
|
|
345
346
|
service.service.async_batch_annotate_files requests, options
|
346
347
|
end
|
347
348
|
|
349
|
+
# rubocop:enable LineLength
|
350
|
+
|
348
351
|
alias mark annotate
|
349
352
|
alias detect annotate
|
350
353
|
|
@@ -17,78 +17,78 @@ require "google/cloud/vision/v1/image_annotator_pb"
|
|
17
17
|
|
18
18
|
module Google
|
19
19
|
module Cloud
|
20
|
-
# rubocop:disable LineLength
|
21
|
-
|
22
|
-
##
|
23
|
-
# # Ruby Client for Cloud Vision API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
24
|
-
#
|
25
|
-
# [Cloud Vision API][Product Documentation]:
|
26
|
-
# Integrates Google Vision features, including image labeling, face, logo, and
|
27
|
-
# landmark detection, optical character recognition (OCR), and detection of
|
28
|
-
# explicit content, into applications.
|
29
|
-
# - [Product Documentation][]
|
30
|
-
#
|
31
|
-
# ## Quick Start
|
32
|
-
# In order to use this library, you first need to go through the following
|
33
|
-
# steps:
|
34
|
-
#
|
35
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
36
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
37
|
-
# 3. [Enable the Cloud Vision API.](https://console.cloud.google.com/apis/api/vision)
|
38
|
-
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
39
|
-
#
|
40
|
-
# ### Preview
|
41
|
-
# #### ImageAnnotatorClient
|
42
|
-
# ```rb
|
43
|
-
# require "google/cloud/vision/v1"
|
44
|
-
#
|
45
|
-
# image_annotator_client = Google::Cloud::Vision::V1.new
|
46
|
-
# gcs_image_uri = "gs://gapic-toolkit/President_Barack_Obama.jpg"
|
47
|
-
# source = { gcs_image_uri: gcs_image_uri }
|
48
|
-
# image = { source: source }
|
49
|
-
# type = :FACE_DETECTION
|
50
|
-
# features_element = { type: type }
|
51
|
-
# features = [features_element]
|
52
|
-
# requests_element = { image: image, features: features }
|
53
|
-
# requests = [requests_element]
|
54
|
-
# response = image_annotator_client.batch_annotate_images(requests)
|
55
|
-
# ```
|
56
|
-
#
|
57
|
-
# ### Next Steps
|
58
|
-
# - Read the [Cloud Vision API Product documentation][Product Documentation]
|
59
|
-
# to learn more about the product and see How-to Guides.
|
60
|
-
# - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
61
|
-
# to see the full list of Cloud APIs that we cover.
|
62
|
-
#
|
63
|
-
# [Product Documentation]: https://cloud.google.com/vision
|
64
|
-
#
|
65
|
-
# ## Enabling Logging
|
66
|
-
#
|
67
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
68
|
-
# 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,
|
69
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
|
70
|
-
# 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)
|
71
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
72
|
-
#
|
73
|
-
# Configuring a Ruby stdlib logger:
|
74
|
-
#
|
75
|
-
# ```ruby
|
76
|
-
# require "logger"
|
77
|
-
#
|
78
|
-
# module MyLogger
|
79
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
80
|
-
# def logger
|
81
|
-
# LOGGER
|
82
|
-
# end
|
83
|
-
# end
|
84
|
-
#
|
85
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
86
|
-
# module GRPC
|
87
|
-
# extend MyLogger
|
88
|
-
# end
|
89
|
-
# ```
|
90
|
-
#
|
91
20
|
module Vision
|
21
|
+
# rubocop:disable LineLength
|
22
|
+
|
23
|
+
##
|
24
|
+
# # Ruby Client for Cloud Vision API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
25
|
+
#
|
26
|
+
# [Cloud Vision API][Product Documentation]:
|
27
|
+
# Integrates Google Vision features, including image labeling, face, logo, and
|
28
|
+
# landmark detection, optical character recognition (OCR), and detection of
|
29
|
+
# explicit content, into applications.
|
30
|
+
# - [Product Documentation][]
|
31
|
+
#
|
32
|
+
# ## Quick Start
|
33
|
+
# In order to use this library, you first need to go through the following
|
34
|
+
# steps:
|
35
|
+
#
|
36
|
+
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
37
|
+
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
38
|
+
# 3. [Enable the Cloud Vision API.](https://console.cloud.google.com/apis/library/vision.googleapis.com)
|
39
|
+
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
40
|
+
#
|
41
|
+
# ### Preview
|
42
|
+
# #### ImageAnnotatorClient
|
43
|
+
# ```rb
|
44
|
+
# require "google/cloud/vision"
|
45
|
+
#
|
46
|
+
# image_annotator_client = Google::Cloud::Vision.new(version: :v1)
|
47
|
+
# gcs_image_uri = "gs://gapic-toolkit/President_Barack_Obama.jpg"
|
48
|
+
# source = { gcs_image_uri: gcs_image_uri }
|
49
|
+
# image = { source: source }
|
50
|
+
# type = :FACE_DETECTION
|
51
|
+
# features_element = { type: type }
|
52
|
+
# features = [features_element]
|
53
|
+
# requests_element = { image: image, features: features }
|
54
|
+
# requests = [requests_element]
|
55
|
+
# response = image_annotator_client.batch_annotate_images(requests)
|
56
|
+
# ```
|
57
|
+
#
|
58
|
+
# ### Next Steps
|
59
|
+
# - Read the [Cloud Vision API Product documentation][Product Documentation]
|
60
|
+
# to learn more about the product and see How-to Guides.
|
61
|
+
# - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
62
|
+
# to see the full list of Cloud APIs that we cover.
|
63
|
+
#
|
64
|
+
# [Product Documentation]: https://cloud.google.com/vision
|
65
|
+
#
|
66
|
+
# ## Enabling Logging
|
67
|
+
#
|
68
|
+
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
69
|
+
# 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,
|
70
|
+
# or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
|
71
|
+
# 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)
|
72
|
+
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
73
|
+
#
|
74
|
+
# Configuring a Ruby stdlib logger:
|
75
|
+
#
|
76
|
+
# ```ruby
|
77
|
+
# require "logger"
|
78
|
+
#
|
79
|
+
# module MyLogger
|
80
|
+
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
81
|
+
# def logger
|
82
|
+
# LOGGER
|
83
|
+
# end
|
84
|
+
# end
|
85
|
+
#
|
86
|
+
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
87
|
+
# module GRPC
|
88
|
+
# extend MyLogger
|
89
|
+
# end
|
90
|
+
# ```
|
91
|
+
#
|
92
92
|
module V1
|
93
93
|
# rubocop:enable LineLength
|
94
94
|
|
@@ -23,8 +23,16 @@ module Google
|
|
23
23
|
"https://www.googleapis.com/auth/cloud-platform",
|
24
24
|
"https://www.googleapis.com/auth/cloud-vision"
|
25
25
|
].freeze
|
26
|
-
PATH_ENV_VARS = %w(
|
27
|
-
|
26
|
+
PATH_ENV_VARS = %w(VISION_CREDENTIALS
|
27
|
+
VISION_KEYFILE
|
28
|
+
GOOGLE_CLOUD_CREDENTIALS
|
29
|
+
GOOGLE_CLOUD_KEYFILE
|
30
|
+
GCLOUD_KEYFILE)
|
31
|
+
JSON_ENV_VARS = %w(VISION_CREDENTIALS_JSON
|
32
|
+
VISION_KEYFILE_JSON
|
33
|
+
GOOGLE_CLOUD_CREDENTIALS_JSON
|
34
|
+
GOOGLE_CLOUD_KEYFILE_JSON
|
35
|
+
GCLOUD_KEYFILE_JSON)
|
28
36
|
DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
|
29
37
|
end
|
30
38
|
end
|
@@ -15,17 +15,6 @@
|
|
15
15
|
module Google
|
16
16
|
module Cloud
|
17
17
|
module Vision
|
18
|
-
##
|
19
|
-
# # Cloud Vision API Contents
|
20
|
-
#
|
21
|
-
# | Class | Description |
|
22
|
-
# | ----- | ----------- |
|
23
|
-
# | [ImageAnnotatorClient][] | Service that performs Google Cloud Vision API detection tasks over client images, such as face, landmark, logo, label, and text detection. |
|
24
|
-
# | [Data Types][] | Data types for Google::Cloud::Vision::V1 |
|
25
|
-
#
|
26
|
-
# [ImageAnnotatorClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-vision/latest/google/cloud/vision/v1/imageannotatorclient
|
27
|
-
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-vision/latest/google/cloud/vision/v1/datatypes
|
28
|
-
#
|
29
18
|
module V1
|
30
19
|
# The type of Google Cloud Vision API detection to perform, and the maximum
|
31
20
|
# number of results to return for that type. Multiple +Feature+ objects can
|
@@ -60,6 +60,7 @@ module Google
|
|
60
60
|
"https://www.googleapis.com/auth/cloud-vision"
|
61
61
|
].freeze
|
62
62
|
|
63
|
+
# @private
|
63
64
|
class OperationsClient < Google::Longrunning::OperationsClient
|
64
65
|
self::SERVICE_ADDRESS = ImageAnnotatorClient::SERVICE_ADDRESS
|
65
66
|
self::GRPC_INTERCEPTORS = ImageAnnotatorClient::GRPC_INTERCEPTORS
|
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.1
|
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-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -109,6 +109,20 @@ dependencies:
|
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '1.1'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: redcarpet
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '3.0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '3.0'
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: rubocop
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,7 +219,6 @@ files:
|
|
205
219
|
- lib/google/cloud/vision/v1/doc/google/rpc/status.rb
|
206
220
|
- lib/google/cloud/vision/v1/doc/google/type/color.rb
|
207
221
|
- lib/google/cloud/vision/v1/doc/google/type/latlng.rb
|
208
|
-
- lib/google/cloud/vision/v1/doc/overview.rb
|
209
222
|
- lib/google/cloud/vision/v1/geometry_pb.rb
|
210
223
|
- lib/google/cloud/vision/v1/image_annotator_client.rb
|
211
224
|
- lib/google/cloud/vision/v1/image_annotator_client_config.json
|
@@ -1,98 +0,0 @@
|
|
1
|
-
# Copyright 2018 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
|
-
module Google
|
16
|
-
module Cloud
|
17
|
-
# rubocop:disable LineLength
|
18
|
-
|
19
|
-
##
|
20
|
-
# # Ruby Client for Cloud Vision API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
21
|
-
#
|
22
|
-
# [Cloud Vision API][Product Documentation]:
|
23
|
-
# Integrates Google Vision features, including image labeling, face, logo, and
|
24
|
-
# landmark detection, optical character recognition (OCR), and detection of
|
25
|
-
# explicit content, into applications.
|
26
|
-
# - [Product Documentation][]
|
27
|
-
#
|
28
|
-
# ## Quick Start
|
29
|
-
# In order to use this library, you first need to go through the following
|
30
|
-
# steps:
|
31
|
-
#
|
32
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
33
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
34
|
-
# 3. [Enable the Cloud Vision API.](https://console.cloud.google.com/apis/api/vision)
|
35
|
-
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
36
|
-
#
|
37
|
-
# ### Installation
|
38
|
-
# ```
|
39
|
-
# $ gem install google-cloud-vision
|
40
|
-
# ```
|
41
|
-
#
|
42
|
-
# ### Preview
|
43
|
-
# #### ImageAnnotatorClient
|
44
|
-
# ```rb
|
45
|
-
# require "google/cloud/vision"
|
46
|
-
#
|
47
|
-
# image_annotator_client = Google::Cloud::Vision.new
|
48
|
-
# gcs_image_uri = "gs://gapic-toolkit/President_Barack_Obama.jpg"
|
49
|
-
# source = { gcs_image_uri: gcs_image_uri }
|
50
|
-
# image = { source: source }
|
51
|
-
# type = :FACE_DETECTION
|
52
|
-
# features_element = { type: type }
|
53
|
-
# features = [features_element]
|
54
|
-
# requests_element = { image: image, features: features }
|
55
|
-
# requests = [requests_element]
|
56
|
-
# response = image_annotator_client.batch_annotate_images(requests)
|
57
|
-
# ```
|
58
|
-
#
|
59
|
-
# ### Next Steps
|
60
|
-
# - Read the [Cloud Vision API Product documentation][Product Documentation]
|
61
|
-
# to learn more about the product and see How-to Guides.
|
62
|
-
# - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
63
|
-
# to see the full list of Cloud APIs that we cover.
|
64
|
-
#
|
65
|
-
# [Product Documentation]: https://cloud.google.com/vision
|
66
|
-
#
|
67
|
-
# ## Enabling Logging
|
68
|
-
#
|
69
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
70
|
-
# 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,
|
71
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
|
72
|
-
# 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)
|
73
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
74
|
-
#
|
75
|
-
# Configuring a Ruby stdlib logger:
|
76
|
-
#
|
77
|
-
# ```ruby
|
78
|
-
# require "logger"
|
79
|
-
#
|
80
|
-
# module MyLogger
|
81
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
82
|
-
# def logger
|
83
|
-
# LOGGER
|
84
|
-
# end
|
85
|
-
# end
|
86
|
-
#
|
87
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
88
|
-
# module GRPC
|
89
|
-
# extend MyLogger
|
90
|
-
# end
|
91
|
-
# ```
|
92
|
-
#
|
93
|
-
module Vision
|
94
|
-
module V1
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|