google-cloud-vision-v1p4beta1 0.3.0 → 0.5.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 +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +3 -3
- data/lib/google/cloud/vision/v1p4beta1/face_pb.rb +24 -14
- data/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb +23 -19
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb +10 -10
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb +14 -16
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb +610 -0
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb +793 -0
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb +280 -0
- data/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb +55 -0
- data/lib/google/cloud/vision/v1p4beta1/image_annotator.rb +7 -1
- data/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb +33 -270
- data/lib/google/cloud/vision/v1p4beta1/product_search/client.rb +26 -34
- data/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb +14 -16
- data/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb +1973 -0
- data/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb +793 -0
- data/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb +1178 -0
- data/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb +70 -0
- data/lib/google/cloud/vision/v1p4beta1/product_search.rb +7 -1
- data/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb +27 -29
- data/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb +28 -148
- data/lib/google/cloud/vision/v1p4beta1/rest.rb +38 -0
- data/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb +25 -66
- data/lib/google/cloud/vision/v1p4beta1/version.rb +1 -1
- data/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb +23 -30
- data/lib/google/cloud/vision/v1p4beta1.rb +7 -2
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb +2 -1
- data/proto_docs/google/protobuf/any.rb +7 -4
- data/proto_docs/google/protobuf/timestamp.rb +1 -3
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +21 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5fad9aa9c8988ddd4753981a9a7dbb1c4fe9adaa724318fcb9a72caf590dd9ac
|
|
4
|
+
data.tar.gz: 91d48f015a9bb957384ed9e7c506b1f10050b1797eb21607aeeeece37d7a0689
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c70ced3ec7f9f9393e6bf679afa4015b44720d2e8900726ebc6e19486421e8c856ab9e7f044671871f423c5d7d5d74895b650121eba6733dcabe6dfbdcc4c702
|
|
7
|
+
data.tar.gz: d3de632f081a27a153697d6721cd497df1bda3dbcee416134c8f0ae49fe2cd5b228cc1509cf042a8babcbd317f28db2fd6b4dcf5b228626e6b7b5043605e2231
|
data/AUTHENTICATION.md
CHANGED
|
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
|
114
114
|
To configure your system for this, simply:
|
|
115
115
|
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
|
118
118
|
3. Write code as if already authenticated.
|
|
119
119
|
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ruby Client for the Cloud Vision V1p4beta1 API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.
|
|
4
4
|
|
|
5
5
|
Cloud Vision API 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.
|
|
6
6
|
|
|
@@ -46,8 +46,8 @@ for general usage information.
|
|
|
46
46
|
## Enabling Logging
|
|
47
47
|
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
|
50
|
-
or a [`Google::Cloud::Logging::Logger`](https://
|
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
|
50
|
+
or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
|
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
|
53
53
|
|
|
@@ -1,26 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
3
|
# source: google/cloud/vision/v1p4beta1/face.proto
|
|
3
4
|
|
|
4
5
|
require 'google/protobuf'
|
|
5
6
|
|
|
6
|
-
require 'google/api/annotations_pb'
|
|
7
7
|
require 'google/cloud/vision/v1p4beta1/geometry_pb'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
|
|
10
|
+
descriptor_data = "\n(google/cloud/vision/v1p4beta1/face.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a,google/cloud/vision/v1p4beta1/geometry.proto\".\n\x15\x46\x61\x63\x65RecognitionParams\x12\x15\n\rcelebrity_set\x18\x01 \x03(\t\"D\n\tCelebrity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"h\n\x15\x46\x61\x63\x65RecognitionResult\x12;\n\tcelebrity\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.Celebrity\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x42z\n!com.google.cloud.vision.v1p4beta1B\x0e\x43\x65lebrityProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3"
|
|
11
|
+
|
|
12
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
13
|
+
|
|
14
|
+
begin
|
|
15
|
+
pool.add_serialized_file(descriptor_data)
|
|
16
|
+
rescue TypeError => e
|
|
17
|
+
# Compatibility code: will be removed in the next major version.
|
|
18
|
+
require 'google/protobuf/descriptor_pb'
|
|
19
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
|
20
|
+
parsed.clear_dependency
|
|
21
|
+
serialized = parsed.class.encode(parsed)
|
|
22
|
+
file = pool.add_serialized_file(serialized)
|
|
23
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
|
24
|
+
imports = [
|
|
25
|
+
]
|
|
26
|
+
imports.each do |type_name, expected_filename|
|
|
27
|
+
import_file = pool.lookup(type_name).file_descriptor
|
|
28
|
+
if import_file.name != expected_filename
|
|
29
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
|
22
30
|
end
|
|
23
31
|
end
|
|
32
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
|
33
|
+
warn "This will become an error in the next major version."
|
|
24
34
|
end
|
|
25
35
|
|
|
26
36
|
module Google
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
3
|
# source: google/cloud/vision/v1p4beta1/geometry.proto
|
|
3
4
|
|
|
4
5
|
require 'google/protobuf'
|
|
5
6
|
|
|
6
|
-
require 'google/api/annotations_pb'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
descriptor_data = "\n,google/cloud/vision/v1p4beta1/geometry.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.NormalizedVertex\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42y\n!com.google.cloud.vision.v1p4beta1B\rGeometryProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3"
|
|
9
|
+
|
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
11
|
+
|
|
12
|
+
begin
|
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
|
14
|
+
rescue TypeError => e
|
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
|
18
|
+
parsed.clear_dependency
|
|
19
|
+
serialized = parsed.class.encode(parsed)
|
|
20
|
+
file = pool.add_serialized_file(serialized)
|
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
|
22
|
+
imports = [
|
|
23
|
+
]
|
|
24
|
+
imports.each do |type_name, expected_filename|
|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
|
26
|
+
if import_file.name != expected_filename
|
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
|
26
28
|
end
|
|
27
29
|
end
|
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
|
31
|
+
warn "This will become an error in the next major version."
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
module Google
|
|
@@ -391,14 +391,14 @@ module Google
|
|
|
391
391
|
# # Call the async_batch_annotate_images method.
|
|
392
392
|
# result = client.async_batch_annotate_images request
|
|
393
393
|
#
|
|
394
|
-
# # The returned object is of type Gapic::Operation. You can use
|
|
395
|
-
# #
|
|
396
|
-
# #
|
|
394
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
395
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
396
|
+
# # Here is how to wait for a response.
|
|
397
397
|
# result.wait_until_done! timeout: 60
|
|
398
398
|
# if result.response?
|
|
399
399
|
# p result.response
|
|
400
400
|
# else
|
|
401
|
-
# puts "
|
|
401
|
+
# puts "No response received."
|
|
402
402
|
# end
|
|
403
403
|
#
|
|
404
404
|
def async_batch_annotate_images request, options = nil
|
|
@@ -481,14 +481,14 @@ module Google
|
|
|
481
481
|
# # Call the async_batch_annotate_files method.
|
|
482
482
|
# result = client.async_batch_annotate_files request
|
|
483
483
|
#
|
|
484
|
-
# # The returned object is of type Gapic::Operation. You can use
|
|
485
|
-
# #
|
|
486
|
-
# #
|
|
484
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
485
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
486
|
+
# # Here is how to wait for a response.
|
|
487
487
|
# result.wait_until_done! timeout: 60
|
|
488
488
|
# if result.response?
|
|
489
489
|
# p result.response
|
|
490
490
|
# else
|
|
491
|
-
# puts "
|
|
491
|
+
# puts "No response received."
|
|
492
492
|
# end
|
|
493
493
|
#
|
|
494
494
|
def async_batch_annotate_files request, options = nil
|
|
@@ -563,9 +563,9 @@ module Google
|
|
|
563
563
|
# * (`String`) The path to a service account key file in JSON format
|
|
564
564
|
# * (`Hash`) A service account key as a Hash
|
|
565
565
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
566
|
-
# (see the [googleauth docs](https://
|
|
566
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
567
567
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
568
|
-
# (see the [signet docs](https://
|
|
568
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
569
569
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
|
570
570
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
|
571
571
|
# * (`nil`) indicating no credentials
|
|
@@ -158,13 +158,11 @@ module Google
|
|
|
158
158
|
# # Call the list_operations method.
|
|
159
159
|
# result = client.list_operations request
|
|
160
160
|
#
|
|
161
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
|
162
|
-
# #
|
|
163
|
-
#
|
|
164
|
-
# # methods are also available for managing paging directly.
|
|
165
|
-
# result.each do |response|
|
|
161
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
162
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
163
|
+
# result.each do |item|
|
|
166
164
|
# # Each element is of type ::Google::Longrunning::Operation.
|
|
167
|
-
# p
|
|
165
|
+
# p item
|
|
168
166
|
# end
|
|
169
167
|
#
|
|
170
168
|
def list_operations request, options = nil
|
|
@@ -253,14 +251,14 @@ module Google
|
|
|
253
251
|
# # Call the get_operation method.
|
|
254
252
|
# result = client.get_operation request
|
|
255
253
|
#
|
|
256
|
-
# # The returned object is of type Gapic::Operation. You can use
|
|
257
|
-
# #
|
|
258
|
-
# #
|
|
254
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
255
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
256
|
+
# # Here is how to wait for a response.
|
|
259
257
|
# result.wait_until_done! timeout: 60
|
|
260
258
|
# if result.response?
|
|
261
259
|
# p result.response
|
|
262
260
|
# else
|
|
263
|
-
# puts "
|
|
261
|
+
# puts "No response received."
|
|
264
262
|
# end
|
|
265
263
|
#
|
|
266
264
|
def get_operation request, options = nil
|
|
@@ -540,14 +538,14 @@ module Google
|
|
|
540
538
|
# # Call the wait_operation method.
|
|
541
539
|
# result = client.wait_operation request
|
|
542
540
|
#
|
|
543
|
-
# # The returned object is of type Gapic::Operation. You can use
|
|
544
|
-
# #
|
|
545
|
-
# #
|
|
541
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
542
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
543
|
+
# # Here is how to wait for a response.
|
|
546
544
|
# result.wait_until_done! timeout: 60
|
|
547
545
|
# if result.response?
|
|
548
546
|
# p result.response
|
|
549
547
|
# else
|
|
550
|
-
# puts "
|
|
548
|
+
# puts "No response received."
|
|
551
549
|
# end
|
|
552
550
|
#
|
|
553
551
|
def wait_operation request, options = nil
|
|
@@ -622,9 +620,9 @@ module Google
|
|
|
622
620
|
# * (`String`) The path to a service account key file in JSON format
|
|
623
621
|
# * (`Hash`) A service account key as a Hash
|
|
624
622
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
625
|
-
# (see the [googleauth docs](https://
|
|
623
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
626
624
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
627
|
-
# (see the [signet docs](https://
|
|
625
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
628
626
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
|
629
627
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
|
630
628
|
# * (`nil`) indicating no credentials
|