google-cloud-vision-v1 0.2.5 → 0.6.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/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/vision/v1.rb +3 -0
- data/lib/google/cloud/vision/v1/image_annotator/client.rb +29 -23
- data/lib/google/cloud/vision/v1/image_annotator/operations.rb +95 -10
- data/lib/google/cloud/vision/v1/image_annotator_pb.rb +7 -0
- data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +5 -6
- data/lib/google/cloud/vision/v1/product_search/client.rb +88 -84
- data/lib/google/cloud/vision/v1/product_search/operations.rb +95 -10
- data/lib/google/cloud/vision/v1/product_search_pb.rb +1 -1
- data/lib/google/cloud/vision/v1/product_search_service_services_pb.rb +20 -21
- data/lib/google/cloud/vision/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +50 -14
- data/proto_docs/google/cloud/vision/v1/image_annotator.rb +26 -2
- data/proto_docs/google/cloud/vision/v1/product_search.rb +1 -1
- data/proto_docs/google/cloud/vision/v1/product_search_service.rb +4 -7
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- data/proto_docs/google/type/latlng.rb +2 -2
- metadata +11 -7
@@ -127,6 +127,9 @@ module Google
|
|
127
127
|
# Image content, represented as a stream of bytes.
|
128
128
|
# Note: As with all `bytes` fields, protobuffers use a pure binary
|
129
129
|
# representation, whereas JSON representations use base64.
|
130
|
+
#
|
131
|
+
# Currently, this field only works for BatchAnnotateImages requests. It does
|
132
|
+
# not work for AsyncBatchAnnotateImages requests.
|
130
133
|
# @!attribute [rw] source
|
131
134
|
# @return [::Google::Cloud::Vision::V1::ImageSource]
|
132
135
|
# Google Cloud Storage image location, or publicly-accessible image
|
@@ -323,6 +326,12 @@ module Google
|
|
323
326
|
|
324
327
|
# Chin right gonion.
|
325
328
|
CHIN_RIGHT_GONION = 34
|
329
|
+
|
330
|
+
# Left cheek center.
|
331
|
+
LEFT_CHEEK_CENTER = 35
|
332
|
+
|
333
|
+
# Right cheek center.
|
334
|
+
RIGHT_CHEEK_CENTER = 36
|
326
335
|
end
|
327
336
|
end
|
328
337
|
end
|
@@ -574,6 +583,18 @@ module Google
|
|
574
583
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
575
584
|
end
|
576
585
|
|
586
|
+
# Parameters for text detections. This is used to control TEXT_DETECTION and
|
587
|
+
# DOCUMENT_TEXT_DETECTION features.
|
588
|
+
# @!attribute [rw] enable_text_detection_confidence_score
|
589
|
+
# @return [::Boolean]
|
590
|
+
# By default, Cloud Vision API only includes confidence score for
|
591
|
+
# DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence
|
592
|
+
# score for TEXT_DETECTION as well.
|
593
|
+
class TextDetectionParams
|
594
|
+
include ::Google::Protobuf::MessageExts
|
595
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
596
|
+
end
|
597
|
+
|
577
598
|
# Image context and/or feature-specific parameters.
|
578
599
|
# @!attribute [rw] lat_long_rect
|
579
600
|
# @return [::Google::Cloud::Vision::V1::LatLongRect]
|
@@ -597,6 +618,9 @@ module Google
|
|
597
618
|
# @!attribute [rw] web_detection_params
|
598
619
|
# @return [::Google::Cloud::Vision::V1::WebDetectionParams]
|
599
620
|
# Parameters for web detection.
|
621
|
+
# @!attribute [rw] text_detection_params
|
622
|
+
# @return [::Google::Cloud::Vision::V1::TextDetectionParams]
|
623
|
+
# Parameters for text detection and document text detection.
|
600
624
|
class ImageContext
|
601
625
|
include ::Google::Protobuf::MessageExts
|
602
626
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -774,8 +798,8 @@ module Google
|
|
774
798
|
# A list of requests to annotate files using the BatchAnnotateFiles API.
|
775
799
|
# @!attribute [rw] requests
|
776
800
|
# @return [::Array<::Google::Cloud::Vision::V1::AnnotateFileRequest>]
|
777
|
-
# Required. The list of file annotation requests. Right now we support only
|
778
|
-
# AnnotateFileRequest in BatchAnnotateFilesRequest.
|
801
|
+
# Required. The list of file annotation requests. Right now we support only
|
802
|
+
# one AnnotateFileRequest in BatchAnnotateFilesRequest.
|
779
803
|
# @!attribute [rw] parent
|
780
804
|
# @return [::String]
|
781
805
|
# Optional. Target project and location to make a call.
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @!attribute [rw] bounding_poly
|
26
26
|
# @return [::Google::Cloud::Vision::V1::BoundingPoly]
|
27
27
|
# The bounding polygon around the area of interest in the image.
|
28
|
-
#
|
28
|
+
# If it is not specified, system discretion will be applied.
|
29
29
|
# @!attribute [rw] product_set
|
30
30
|
# @return [::String]
|
31
31
|
# The resource name of a {::Google::Cloud::Vision::V1::ProductSet ProductSet} to be searched for similar images.
|
@@ -41,9 +41,9 @@ module Google
|
|
41
41
|
# @!attribute [rw] product_category
|
42
42
|
# @return [::String]
|
43
43
|
# Immutable. The category for the product identified by the reference image. This should
|
44
|
-
# be
|
45
|
-
# "homegoods", "apparel", and "toys" are
|
46
|
-
# not be used for new products.
|
44
|
+
# be one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or
|
45
|
+
# "general-v1". The legacy categories "homegoods", "apparel", and "toys" are
|
46
|
+
# still supported, but these should not be used for new products.
|
47
47
|
# @!attribute [rw] product_labels
|
48
48
|
# @return [::Array<::Google::Cloud::Vision::V1::Product::KeyValue>]
|
49
49
|
# Key-value pairs that can be attached to a product. At query time,
|
@@ -119,7 +119,6 @@ module Google
|
|
119
119
|
# The resource name of the reference image.
|
120
120
|
#
|
121
121
|
# Format is:
|
122
|
-
#
|
123
122
|
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
|
124
123
|
#
|
125
124
|
# This field is ignored when creating a reference image.
|
@@ -292,7 +291,7 @@ module Google
|
|
292
291
|
# Required. Resource name of the ProductSet to get.
|
293
292
|
#
|
294
293
|
# Format is:
|
295
|
-
# `projects/PROJECT_ID/locations/
|
294
|
+
# `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
296
295
|
class GetProductSetRequest
|
297
296
|
include ::Google::Protobuf::MessageExts
|
298
297
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -389,7 +388,6 @@ module Google
|
|
389
388
|
# Required. The resource name of the ReferenceImage to get.
|
390
389
|
#
|
391
390
|
# Format is:
|
392
|
-
#
|
393
391
|
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
|
394
392
|
class GetReferenceImageRequest
|
395
393
|
include ::Google::Protobuf::MessageExts
|
@@ -402,7 +400,6 @@ module Google
|
|
402
400
|
# Required. The resource name of the reference image to delete.
|
403
401
|
#
|
404
402
|
# Format is:
|
405
|
-
#
|
406
403
|
# `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
|
407
404
|
class DeleteReferenceImageRequest
|
408
405
|
include ::Google::Protobuf::MessageExts
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @return [::String]
|
26
26
|
# The server-assigned name, which is only unique within the same service that
|
27
27
|
# originally returns it. If you use the default HTTP mapping, the
|
28
|
-
# `name` should
|
28
|
+
# `name` should be a resource name ending with `operations/{unique_id}`.
|
29
29
|
# @!attribute [rw] metadata
|
30
30
|
# @return [::Google::Protobuf::Any]
|
31
31
|
# Service-specific metadata associated with the operation. It typically
|
@@ -35,7 +35,7 @@ module Google
|
|
35
35
|
# @!attribute [rw] done
|
36
36
|
# @return [::Boolean]
|
37
37
|
# If the value is `false`, it means the operation is still in progress.
|
38
|
-
# If true
|
38
|
+
# If `true`, the operation is completed, and either `error` or `response` is
|
39
39
|
# available.
|
40
40
|
# @!attribute [rw] error
|
41
41
|
# @return [::Google::Rpc::Status]
|
@@ -67,7 +67,7 @@ module Google
|
|
67
67
|
# The request message for Operations.ListOperations.
|
68
68
|
# @!attribute [rw] name
|
69
69
|
# @return [::String]
|
70
|
-
# The name of the operation
|
70
|
+
# The name of the operation's parent resource.
|
71
71
|
# @!attribute [rw] filter
|
72
72
|
# @return [::String]
|
73
73
|
# The standard list filter.
|
@@ -112,6 +112,20 @@ module Google
|
|
112
112
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
113
113
|
end
|
114
114
|
|
115
|
+
# The request message for Operations.WaitOperation.
|
116
|
+
# @!attribute [rw] name
|
117
|
+
# @return [::String]
|
118
|
+
# The name of the operation resource to wait on.
|
119
|
+
# @!attribute [rw] timeout
|
120
|
+
# @return [::Google::Protobuf::Duration]
|
121
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
122
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
123
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
124
|
+
class WaitOperationRequest
|
125
|
+
include ::Google::Protobuf::MessageExts
|
126
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
127
|
+
end
|
128
|
+
|
115
129
|
# A message representing the message types used by a long-running operation.
|
116
130
|
#
|
117
131
|
# Example:
|
@@ -57,10 +57,13 @@ module Google
|
|
57
57
|
# Example 4: Pack and unpack a message in Go
|
58
58
|
#
|
59
59
|
# foo := &pb.Foo{...}
|
60
|
-
# any, err :=
|
60
|
+
# any, err := anypb.New(foo)
|
61
|
+
# if err != nil {
|
62
|
+
# ...
|
63
|
+
# }
|
61
64
|
# ...
|
62
65
|
# foo := &pb.Foo{}
|
63
|
-
# if err :=
|
66
|
+
# if err := any.UnmarshalTo(foo); err != nil {
|
64
67
|
# ...
|
65
68
|
# }
|
66
69
|
#
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 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 Protobuf
|
22
|
+
# A Duration represents a signed, fixed-length span of time represented
|
23
|
+
# as a count of seconds and fractions of seconds at nanosecond
|
24
|
+
# resolution. It is independent of any calendar and concepts like "day"
|
25
|
+
# or "month". It is related to Timestamp in that the difference between
|
26
|
+
# two Timestamp values is a Duration and it can be added or subtracted
|
27
|
+
# from a Timestamp. Range is approximately +-10,000 years.
|
28
|
+
#
|
29
|
+
# # Examples
|
30
|
+
#
|
31
|
+
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
32
|
+
#
|
33
|
+
# Timestamp start = ...;
|
34
|
+
# Timestamp end = ...;
|
35
|
+
# Duration duration = ...;
|
36
|
+
#
|
37
|
+
# duration.seconds = end.seconds - start.seconds;
|
38
|
+
# duration.nanos = end.nanos - start.nanos;
|
39
|
+
#
|
40
|
+
# if (duration.seconds < 0 && duration.nanos > 0) {
|
41
|
+
# duration.seconds += 1;
|
42
|
+
# duration.nanos -= 1000000000;
|
43
|
+
# } else if (duration.seconds > 0 && duration.nanos < 0) {
|
44
|
+
# duration.seconds -= 1;
|
45
|
+
# duration.nanos += 1000000000;
|
46
|
+
# }
|
47
|
+
#
|
48
|
+
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
49
|
+
#
|
50
|
+
# Timestamp start = ...;
|
51
|
+
# Duration duration = ...;
|
52
|
+
# Timestamp end = ...;
|
53
|
+
#
|
54
|
+
# end.seconds = start.seconds + duration.seconds;
|
55
|
+
# end.nanos = start.nanos + duration.nanos;
|
56
|
+
#
|
57
|
+
# if (end.nanos < 0) {
|
58
|
+
# end.seconds -= 1;
|
59
|
+
# end.nanos += 1000000000;
|
60
|
+
# } else if (end.nanos >= 1000000000) {
|
61
|
+
# end.seconds += 1;
|
62
|
+
# end.nanos -= 1000000000;
|
63
|
+
# }
|
64
|
+
#
|
65
|
+
# Example 3: Compute Duration from datetime.timedelta in Python.
|
66
|
+
#
|
67
|
+
# td = datetime.timedelta(days=3, minutes=10)
|
68
|
+
# duration = Duration()
|
69
|
+
# duration.FromTimedelta(td)
|
70
|
+
#
|
71
|
+
# # JSON Mapping
|
72
|
+
#
|
73
|
+
# In JSON format, the Duration type is encoded as a string rather than an
|
74
|
+
# object, where the string ends in the suffix "s" (indicating seconds) and
|
75
|
+
# is preceded by the number of seconds, with nanoseconds expressed as
|
76
|
+
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
77
|
+
# encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
78
|
+
# be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
79
|
+
# microsecond should be expressed in JSON format as "3.000001s".
|
80
|
+
# @!attribute [rw] seconds
|
81
|
+
# @return [::Integer]
|
82
|
+
# Signed seconds of the span of time. Must be from -315,576,000,000
|
83
|
+
# to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
84
|
+
# 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
85
|
+
# @!attribute [rw] nanos
|
86
|
+
# @return [::Integer]
|
87
|
+
# Signed fractions of a second at nanosecond resolution of the span
|
88
|
+
# of time. Durations less than one second are represented with a 0
|
89
|
+
# `seconds` field and a positive or negative `nanos` field. For durations
|
90
|
+
# of one second or more, a non-zero value for the `nanos` field must be
|
91
|
+
# of the same sign as the `seconds` field. Must be from -999,999,999
|
92
|
+
# to +999,999,999 inclusive.
|
93
|
+
class Duration
|
94
|
+
include ::Google::Protobuf::MessageExts
|
95
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -70,7 +70,16 @@ module Google
|
|
70
70
|
# .setNanos((int) ((millis % 1000) * 1000000)).build();
|
71
71
|
#
|
72
72
|
#
|
73
|
-
# Example 5: Compute Timestamp from
|
73
|
+
# Example 5: Compute Timestamp from Java `Instant.now()`.
|
74
|
+
#
|
75
|
+
# Instant now = Instant.now();
|
76
|
+
#
|
77
|
+
# Timestamp timestamp =
|
78
|
+
# Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
79
|
+
# .setNanos(now.getNano()).build();
|
80
|
+
#
|
81
|
+
#
|
82
|
+
# Example 6: Compute Timestamp from current time in Python.
|
74
83
|
#
|
75
84
|
# timestamp = Timestamp()
|
76
85
|
# timestamp.GetCurrentTime()
|
@@ -19,8 +19,8 @@
|
|
19
19
|
|
20
20
|
module Google
|
21
21
|
module Type
|
22
|
-
# An object
|
23
|
-
# of doubles
|
22
|
+
# An object that represents a latitude/longitude pair. This is expressed as a
|
23
|
+
# pair of doubles to represent degrees latitude and degrees longitude. Unless
|
24
24
|
# specified otherwise, this must conform to the
|
25
25
|
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
26
26
|
# standard</a>. Values must be within normalized ranges.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-vision-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.25.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.25.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,7 +152,10 @@ dependencies:
|
|
152
152
|
version: '0.9'
|
153
153
|
description: Cloud Vision API allows developers to easily integrate vision detection
|
154
154
|
features within applications, including image labeling, face and landmark detection,
|
155
|
-
optical character recognition (OCR), and tagging of explicit content.
|
155
|
+
optical character recognition (OCR), and tagging of explicit content. Note that
|
156
|
+
google-cloud-vision-v1 is a version-specific client library. For most uses, we recommend
|
157
|
+
installing the main client library google-cloud-vision instead. See the readme for
|
158
|
+
more details.
|
156
159
|
email: googleapis-packages@google.com
|
157
160
|
executables: []
|
158
161
|
extensions: []
|
@@ -195,6 +198,7 @@ files:
|
|
195
198
|
- proto_docs/google/cloud/vision/v1/web_detection.rb
|
196
199
|
- proto_docs/google/longrunning/operations.rb
|
197
200
|
- proto_docs/google/protobuf/any.rb
|
201
|
+
- proto_docs/google/protobuf/duration.rb
|
198
202
|
- proto_docs/google/protobuf/empty.rb
|
199
203
|
- proto_docs/google/protobuf/field_mask.rb
|
200
204
|
- proto_docs/google/protobuf/timestamp.rb
|
@@ -214,14 +218,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
218
|
requirements:
|
215
219
|
- - ">="
|
216
220
|
- !ruby/object:Gem::Version
|
217
|
-
version: '2.
|
221
|
+
version: '2.5'
|
218
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
223
|
requirements:
|
220
224
|
- - ">="
|
221
225
|
- !ruby/object:Gem::Version
|
222
226
|
version: '0'
|
223
227
|
requirements: []
|
224
|
-
rubygems_version: 3.
|
228
|
+
rubygems_version: 3.2.13
|
225
229
|
signing_key:
|
226
230
|
specification_version: 4
|
227
231
|
summary: API Client library for the Cloud Vision V1 API
|