google-cloud-video_intelligence 2.1.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -54
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +274 -0
  6. data/README.md +36 -62
  7. data/lib/{google/cloud/video_intelligence/credentials.rb → google-cloud-video_intelligence.rb} +5 -13
  8. data/lib/google/cloud/video_intelligence.rb +87 -156
  9. data/lib/google/cloud/video_intelligence/version.rb +6 -2
  10. metadata +99 -83
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/video_intelligence/v1.rb +0 -186
  13. data/lib/google/cloud/video_intelligence/v1/credentials.rb +0 -41
  14. data/lib/google/cloud/video_intelligence/v1/doc/google/cloud/videointelligence/v1/video_intelligence.rb +0 -789
  15. data/lib/google/cloud/video_intelligence/v1/doc/google/longrunning/operations.rb +0 -51
  16. data/lib/google/cloud/video_intelligence/v1/doc/google/protobuf/any.rb +0 -131
  17. data/lib/google/cloud/video_intelligence/v1/doc/google/protobuf/duration.rb +0 -91
  18. data/lib/google/cloud/video_intelligence/v1/doc/google/rpc/status.rb +0 -39
  19. data/lib/google/cloud/video_intelligence/v1/video_intelligence_service_client.rb +0 -309
  20. data/lib/google/cloud/video_intelligence/v1/video_intelligence_service_client_config.json +0 -31
  21. data/lib/google/cloud/video_intelligence/v1beta2.rb +0 -149
  22. data/lib/google/cloud/video_intelligence/v1beta2/credentials.rb +0 -41
  23. data/lib/google/cloud/video_intelligence/v1beta2/doc/google/cloud/videointelligence/v1beta2/video_intelligence.rb +0 -372
  24. data/lib/google/cloud/video_intelligence/v1beta2/doc/google/longrunning/operations.rb +0 -51
  25. data/lib/google/cloud/video_intelligence/v1beta2/doc/google/protobuf/any.rb +0 -131
  26. data/lib/google/cloud/video_intelligence/v1beta2/doc/google/protobuf/duration.rb +0 -91
  27. data/lib/google/cloud/video_intelligence/v1beta2/doc/google/rpc/status.rb +0 -39
  28. data/lib/google/cloud/video_intelligence/v1beta2/video_intelligence_service_client.rb +0 -309
  29. data/lib/google/cloud/video_intelligence/v1beta2/video_intelligence_service_client_config.json +0 -31
  30. data/lib/google/cloud/video_intelligence/v1p1beta1.rb +0 -187
  31. data/lib/google/cloud/video_intelligence/v1p1beta1/credentials.rb +0 -41
  32. data/lib/google/cloud/video_intelligence/v1p1beta1/doc/google/cloud/videointelligence/v1p1beta1/video_intelligence.rb +0 -410
  33. data/lib/google/cloud/video_intelligence/v1p1beta1/doc/google/longrunning/operations.rb +0 -51
  34. data/lib/google/cloud/video_intelligence/v1p1beta1/doc/google/protobuf/any.rb +0 -131
  35. data/lib/google/cloud/video_intelligence/v1p1beta1/doc/google/protobuf/duration.rb +0 -91
  36. data/lib/google/cloud/video_intelligence/v1p1beta1/doc/google/rpc/status.rb +0 -39
  37. data/lib/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_client.rb +0 -309
  38. data/lib/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_client_config.json +0 -31
  39. data/lib/google/cloud/video_intelligence/v1p2beta1.rb +0 -187
  40. data/lib/google/cloud/video_intelligence/v1p2beta1/credentials.rb +0 -41
  41. data/lib/google/cloud/video_intelligence/v1p2beta1/doc/google/cloud/videointelligence/v1p2beta1/video_intelligence.rb +0 -442
  42. data/lib/google/cloud/video_intelligence/v1p2beta1/doc/google/longrunning/operations.rb +0 -51
  43. data/lib/google/cloud/video_intelligence/v1p2beta1/doc/google/protobuf/any.rb +0 -131
  44. data/lib/google/cloud/video_intelligence/v1p2beta1/doc/google/protobuf/duration.rb +0 -91
  45. data/lib/google/cloud/video_intelligence/v1p2beta1/doc/google/rpc/status.rb +0 -39
  46. data/lib/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_client.rb +0 -309
  47. data/lib/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_client_config.json +0 -31
  48. data/lib/google/cloud/videointelligence/v1/video_intelligence_pb.rb +0 -304
  49. data/lib/google/cloud/videointelligence/v1/video_intelligence_services_pb.rb +0 -50
  50. data/lib/google/cloud/videointelligence/v1beta2/video_intelligence_pb.rb +0 -170
  51. data/lib/google/cloud/videointelligence/v1beta2/video_intelligence_services_pb.rb +0 -51
  52. data/lib/google/cloud/videointelligence/v1p1beta1/video_intelligence_pb.rb +0 -172
  53. data/lib/google/cloud/videointelligence/v1p1beta1/video_intelligence_services_pb.rb +0 -51
  54. data/lib/google/cloud/videointelligence/v1p2beta1/video_intelligence_pb.rb +0 -193
  55. data/lib/google/cloud/videointelligence/v1p2beta1/video_intelligence_services_pb.rb +0 -51
@@ -1,31 +0,0 @@
1
- {
2
- "interfaces": {
3
- "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService": {
4
- "retry_codes": {
5
- "idempotent": [
6
- "DEADLINE_EXCEEDED",
7
- "UNAVAILABLE"
8
- ],
9
- "non_idempotent": []
10
- },
11
- "retry_params": {
12
- "default": {
13
- "initial_retry_delay_millis": 1000,
14
- "retry_delay_multiplier": 2.5,
15
- "max_retry_delay_millis": 120000,
16
- "initial_rpc_timeout_millis": 120000,
17
- "rpc_timeout_multiplier": 1.0,
18
- "max_rpc_timeout_millis": 120000,
19
- "total_timeout_millis": 600000
20
- }
21
- },
22
- "methods": {
23
- "AnnotateVideo": {
24
- "timeout_millis": 600000,
25
- "retry_codes_name": "idempotent",
26
- "retry_params_name": "default"
27
- }
28
- }
29
- }
30
- }
31
- }
@@ -1,187 +0,0 @@
1
- # Copyright 2020 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
-
16
- require "google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_client"
17
- require "google/rpc/status_pb"
18
- require "google/cloud/videointelligence/v1p2beta1/video_intelligence_pb"
19
-
20
- module Google
21
- module Cloud
22
- module VideoIntelligence
23
- # rubocop:disable LineLength
24
-
25
- ##
26
- # # Ruby Client for Cloud Video Intelligence API
27
- #
28
- # [Cloud Video Intelligence API][Product Documentation]:
29
- # Detects objects, explicit content, and scene changes in videos. It also
30
- # specifies the region for annotation and transcribes speech to text.
31
- # Supports both asynchronous API and streaming API.
32
- # - [Product Documentation][]
33
- #
34
- # ## Quick Start
35
- # In order to use this library, you first need to go through the following
36
- # steps:
37
- #
38
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
39
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
40
- # 3. [Enable the Cloud Video Intelligence API.](https://console.cloud.google.com/apis/library/videointelligence.googleapis.com)
41
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-video_intelligence/latest/file.AUTHENTICATION.html)
42
- #
43
- # ### Installation
44
- # ```
45
- # $ gem install google-cloud-video_intelligence
46
- # ```
47
- #
48
- # ### Preview
49
- # #### VideoIntelligenceServiceClient
50
- # ```rb
51
- # require "google/cloud/video_intelligence"
52
- #
53
- # video_intelligence_client = Google::Cloud::VideoIntelligence.new(version: :v1p2beta1)
54
- # input_uri = "gs://cloud-samples-data/video/cat.mp4"
55
- # features_element = :LABEL_DETECTION
56
- # features = [features_element]
57
- #
58
- # # Register a callback during the method call.
59
- # operation = video_intelligence_client.annotate_video(input_uri: input_uri, features: features) do |op|
60
- # raise op.results.message if op.error?
61
- # op_results = op.results
62
- # # Process the results.
63
- #
64
- # metadata = op.metadata
65
- # # Process the metadata.
66
- # end
67
- #
68
- # # Or use the return value to register a callback.
69
- # operation.on_done do |op|
70
- # raise op.results.message if op.error?
71
- # op_results = op.results
72
- # # Process the results.
73
- #
74
- # metadata = op.metadata
75
- # # Process the metadata.
76
- # end
77
- #
78
- # # Manually reload the operation.
79
- # operation.reload!
80
- #
81
- # # Or block until the operation completes, triggering callbacks on
82
- # # completion.
83
- # operation.wait_until_done!
84
- # ```
85
- #
86
- # ### Next Steps
87
- # - Read the [Cloud Video Intelligence API Product documentation][Product Documentation]
88
- # to learn more about the product and see How-to Guides.
89
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
90
- # to see the full list of Cloud APIs that we cover.
91
- #
92
- # [Product Documentation]: https://cloud.google.com/video-intelligence
93
- #
94
- # ## Enabling Logging
95
- #
96
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
97
- # 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,
98
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
99
- # 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)
100
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
101
- #
102
- # Configuring a Ruby stdlib logger:
103
- #
104
- # ```ruby
105
- # require "logger"
106
- #
107
- # module MyLogger
108
- # LOGGER = Logger.new $stderr, level: Logger::WARN
109
- # def logger
110
- # LOGGER
111
- # end
112
- # end
113
- #
114
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
115
- # module GRPC
116
- # extend MyLogger
117
- # end
118
- # ```
119
- #
120
- module V1p2beta1
121
- # rubocop:enable LineLength
122
-
123
- ##
124
- # Service that implements Google Cloud Video Intelligence API.
125
- #
126
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
127
- # Provides the means for authenticating requests made by the client. This parameter can
128
- # be many types.
129
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
130
- # authenticating requests made by this client.
131
- # A `String` will be treated as the path to the keyfile to be used for the construction of
132
- # credentials for this client.
133
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
134
- # credentials for this client.
135
- # A `GRPC::Core::Channel` will be used to make calls through.
136
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
137
- # should already be composed with a `GRPC::Core::CallCredentials` object.
138
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
139
- # metadata for requests, generally, to give OAuth credentials.
140
- # @param scopes [Array<String>]
141
- # The OAuth scopes for this service. This parameter is ignored if
142
- # an updater_proc is supplied.
143
- # @param client_config [Hash]
144
- # A Hash for call options for each method. See
145
- # Google::Gax#construct_settings for the structure of
146
- # this data. Falls back to the default config if not specified
147
- # or the specified config is missing data points.
148
- # @param timeout [Numeric]
149
- # The default timeout, in seconds, for calls made through this client.
150
- # @param metadata [Hash]
151
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
152
- # @param service_address [String]
153
- # Override for the service hostname, or `nil` to leave as the default.
154
- # @param service_port [Integer]
155
- # Override for the service port, or `nil` to leave as the default.
156
- # @param exception_transformer [Proc]
157
- # An optional proc that intercepts any exceptions raised during an API call to inject
158
- # custom error handling.
159
- def self.new \
160
- credentials: nil,
161
- scopes: nil,
162
- client_config: nil,
163
- timeout: nil,
164
- metadata: nil,
165
- service_address: nil,
166
- service_port: nil,
167
- exception_transformer: nil,
168
- lib_name: nil,
169
- lib_version: nil
170
- kwargs = {
171
- credentials: credentials,
172
- scopes: scopes,
173
- client_config: client_config,
174
- timeout: timeout,
175
- metadata: metadata,
176
- exception_transformer: exception_transformer,
177
- lib_name: lib_name,
178
- service_address: service_address,
179
- service_port: service_port,
180
- lib_version: lib_version
181
- }.select { |_, v| v != nil }
182
- Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceServiceClient.new(**kwargs)
183
- end
184
- end
185
- end
186
- end
187
- end
@@ -1,41 +0,0 @@
1
- # Copyright 2020 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
-
16
- require "googleauth"
17
-
18
- module Google
19
- module Cloud
20
- module VideoIntelligence
21
- module V1p2beta1
22
- class Credentials < Google::Auth::Credentials
23
- SCOPE = [
24
- "https://www.googleapis.com/auth/cloud-platform"
25
- ].freeze
26
- PATH_ENV_VARS = %w(VIDEO_INTELLIGENCE_CREDENTIALS
27
- VIDEO_INTELLIGENCE_KEYFILE
28
- GOOGLE_CLOUD_CREDENTIALS
29
- GOOGLE_CLOUD_KEYFILE
30
- GCLOUD_KEYFILE)
31
- JSON_ENV_VARS = %w(VIDEO_INTELLIGENCE_CREDENTIALS_JSON
32
- VIDEO_INTELLIGENCE_KEYFILE_JSON
33
- GOOGLE_CLOUD_CREDENTIALS_JSON
34
- GOOGLE_CLOUD_KEYFILE_JSON
35
- GCLOUD_KEYFILE_JSON)
36
- DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,442 +0,0 @@
1
- # Copyright 2020 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
-
16
- module Google
17
- module Cloud
18
- module VideoIntelligence
19
- module V1p2beta1
20
- # Video annotation request.
21
- # @!attribute [rw] input_uri
22
- # @return [String]
23
- # Input video location. Currently, only
24
- # [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
25
- # supported, which must be specified in the following format:
26
- # `gs://bucket-id/object-id` (other URI formats return
27
- # {Google::Rpc::Code::INVALID_ARGUMENT}). For more information, see
28
- # [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
29
- # A video URI may include wildcards in `object-id`, and thus identify
30
- # multiple videos. Supported wildcards: '*' to match 0 or more characters;
31
- # '?' to match 1 character. If unset, the input video should be embedded
32
- # in the request as `input_content`. If set, `input_content` should be unset.
33
- # @!attribute [rw] input_content
34
- # @return [String]
35
- # The video data bytes.
36
- # If unset, the input video(s) should be specified via `input_uri`.
37
- # If set, `input_uri` should be unset.
38
- # @!attribute [rw] features
39
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::Feature>]
40
- # Required. Requested video annotation features.
41
- # @!attribute [rw] video_context
42
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::VideoContext]
43
- # Additional video context and/or feature-specific parameters.
44
- # @!attribute [rw] output_uri
45
- # @return [String]
46
- # Optional. Location where the output (in JSON format) should be stored.
47
- # Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
48
- # URIs are supported, which must be specified in the following format:
49
- # `gs://bucket-id/object-id` (other URI formats return
50
- # {Google::Rpc::Code::INVALID_ARGUMENT}). For more information, see
51
- # [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
52
- # @!attribute [rw] location_id
53
- # @return [String]
54
- # Optional. Cloud region where annotation should take place. Supported cloud
55
- # regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
56
- # is specified, a region will be determined based on video file location.
57
- class AnnotateVideoRequest; end
58
-
59
- # Video context and/or feature-specific parameters.
60
- # @!attribute [rw] segments
61
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::VideoSegment>]
62
- # Video segments to annotate. The segments may overlap and are not required
63
- # to be contiguous or span the whole video. If unspecified, each video is
64
- # treated as a single segment.
65
- # @!attribute [rw] label_detection_config
66
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::LabelDetectionConfig]
67
- # Config for LABEL_DETECTION.
68
- # @!attribute [rw] shot_change_detection_config
69
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::ShotChangeDetectionConfig]
70
- # Config for SHOT_CHANGE_DETECTION.
71
- # @!attribute [rw] explicit_content_detection_config
72
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::ExplicitContentDetectionConfig]
73
- # Config for EXPLICIT_CONTENT_DETECTION.
74
- # @!attribute [rw] text_detection_config
75
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::TextDetectionConfig]
76
- # Config for TEXT_DETECTION.
77
- class VideoContext; end
78
-
79
- # Config for LABEL_DETECTION.
80
- # @!attribute [rw] label_detection_mode
81
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::LabelDetectionMode]
82
- # What labels should be detected with LABEL_DETECTION, in addition to
83
- # video-level labels or segment-level labels.
84
- # If unspecified, defaults to `SHOT_MODE`.
85
- # @!attribute [rw] stationary_camera
86
- # @return [true, false]
87
- # Whether the video has been shot from a stationary (i.e. non-moving) camera.
88
- # When set to true, might improve detection accuracy for moving objects.
89
- # Should be used with `SHOT_AND_FRAME_MODE` enabled.
90
- # @!attribute [rw] model
91
- # @return [String]
92
- # Model to use for label detection.
93
- # Supported values: "builtin/stable" (the default if unset) and
94
- # "builtin/latest".
95
- class LabelDetectionConfig; end
96
-
97
- # Config for SHOT_CHANGE_DETECTION.
98
- # @!attribute [rw] model
99
- # @return [String]
100
- # Model to use for shot change detection.
101
- # Supported values: "builtin/stable" (the default if unset) and
102
- # "builtin/latest".
103
- class ShotChangeDetectionConfig; end
104
-
105
- # Config for EXPLICIT_CONTENT_DETECTION.
106
- # @!attribute [rw] model
107
- # @return [String]
108
- # Model to use for explicit content detection.
109
- # Supported values: "builtin/stable" (the default if unset) and
110
- # "builtin/latest".
111
- class ExplicitContentDetectionConfig; end
112
-
113
- # Config for TEXT_DETECTION.
114
- # @!attribute [rw] language_hints
115
- # @return [Array<String>]
116
- # Language hint can be specified if the language to be detected is known a
117
- # priori. It can increase the accuracy of the detection. Language hint must
118
- # be language code in BCP-47 format.
119
- #
120
- # Automatic language detection is performed if no hint is provided.
121
- class TextDetectionConfig; end
122
-
123
- # Video segment.
124
- # @!attribute [rw] start_time_offset
125
- # @return [Google::Protobuf::Duration]
126
- # Time-offset, relative to the beginning of the video,
127
- # corresponding to the start of the segment (inclusive).
128
- # @!attribute [rw] end_time_offset
129
- # @return [Google::Protobuf::Duration]
130
- # Time-offset, relative to the beginning of the video,
131
- # corresponding to the end of the segment (inclusive).
132
- class VideoSegment; end
133
-
134
- # Video segment level annotation results for label detection.
135
- # @!attribute [rw] segment
136
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::VideoSegment]
137
- # Video segment where a label was detected.
138
- # @!attribute [rw] confidence
139
- # @return [Float]
140
- # Confidence that the label is accurate. Range: [0, 1].
141
- class LabelSegment; end
142
-
143
- # Video frame level annotation results for label detection.
144
- # @!attribute [rw] time_offset
145
- # @return [Google::Protobuf::Duration]
146
- # Time-offset, relative to the beginning of the video, corresponding to the
147
- # video frame for this location.
148
- # @!attribute [rw] confidence
149
- # @return [Float]
150
- # Confidence that the label is accurate. Range: [0, 1].
151
- class LabelFrame; end
152
-
153
- # Detected entity from video analysis.
154
- # @!attribute [rw] entity_id
155
- # @return [String]
156
- # Opaque entity ID. Some IDs may be available in
157
- # [Google Knowledge Graph Search
158
- # API](https://developers.google.com/knowledge-graph/).
159
- # @!attribute [rw] description
160
- # @return [String]
161
- # Textual description, e.g. `Fixed-gear bicycle`.
162
- # @!attribute [rw] language_code
163
- # @return [String]
164
- # Language code for `description` in BCP-47 format.
165
- class Entity; end
166
-
167
- # Label annotation.
168
- # @!attribute [rw] entity
169
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::Entity]
170
- # Detected entity.
171
- # @!attribute [rw] category_entities
172
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::Entity>]
173
- # Common categories for the detected entity.
174
- # E.g. when the label is `Terrier` the category is likely `dog`. And in some
175
- # cases there might be more than one categories e.g. `Terrier` could also be
176
- # a `pet`.
177
- # @!attribute [rw] segments
178
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::LabelSegment>]
179
- # All video segments where a label was detected.
180
- # @!attribute [rw] frames
181
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::LabelFrame>]
182
- # All video frames where a label was detected.
183
- class LabelAnnotation; end
184
-
185
- # Video frame level annotation results for explicit content.
186
- # @!attribute [rw] time_offset
187
- # @return [Google::Protobuf::Duration]
188
- # Time-offset, relative to the beginning of the video, corresponding to the
189
- # video frame for this location.
190
- # @!attribute [rw] pornography_likelihood
191
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::Likelihood]
192
- # Likelihood of the pornography content..
193
- class ExplicitContentFrame; end
194
-
195
- # Explicit content annotation (based on per-frame visual signals only).
196
- # If no explicit content has been detected in a frame, no annotations are
197
- # present for that frame.
198
- # @!attribute [rw] frames
199
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::ExplicitContentFrame>]
200
- # All video frames where explicit content was detected.
201
- class ExplicitContentAnnotation; end
202
-
203
- # Normalized bounding box.
204
- # The normalized vertex coordinates are relative to the original image.
205
- # Range: [0, 1].
206
- # @!attribute [rw] left
207
- # @return [Float]
208
- # Left X coordinate.
209
- # @!attribute [rw] top
210
- # @return [Float]
211
- # Top Y coordinate.
212
- # @!attribute [rw] right
213
- # @return [Float]
214
- # Right X coordinate.
215
- # @!attribute [rw] bottom
216
- # @return [Float]
217
- # Bottom Y coordinate.
218
- class NormalizedBoundingBox; end
219
-
220
- # Annotation results for a single video.
221
- # @!attribute [rw] input_uri
222
- # @return [String]
223
- # Video file location in
224
- # [Google Cloud Storage](https://cloud.google.com/storage/).
225
- # @!attribute [rw] segment_label_annotations
226
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::LabelAnnotation>]
227
- # Label annotations on video level or user specified segment level.
228
- # There is exactly one element for each unique label.
229
- # @!attribute [rw] shot_label_annotations
230
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::LabelAnnotation>]
231
- # Label annotations on shot level.
232
- # There is exactly one element for each unique label.
233
- # @!attribute [rw] frame_label_annotations
234
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::LabelAnnotation>]
235
- # Label annotations on frame level.
236
- # There is exactly one element for each unique label.
237
- # @!attribute [rw] shot_annotations
238
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::VideoSegment>]
239
- # Shot annotations. Each shot is represented as a video segment.
240
- # @!attribute [rw] explicit_annotation
241
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::ExplicitContentAnnotation]
242
- # Explicit content annotation.
243
- # @!attribute [rw] text_annotations
244
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::TextAnnotation>]
245
- # OCR text detection and tracking.
246
- # Annotations for list of detected text snippets. Each will have list of
247
- # frame information associated with it.
248
- # @!attribute [rw] object_annotations
249
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::ObjectTrackingAnnotation>]
250
- # Annotations for list of objects detected and tracked in video.
251
- # @!attribute [rw] error
252
- # @return [Google::Rpc::Status]
253
- # If set, indicates an error. Note that for a single `AnnotateVideoRequest`
254
- # some videos may succeed and some may fail.
255
- class VideoAnnotationResults; end
256
-
257
- # Video annotation response. Included in the `response`
258
- # field of the `Operation` returned by the `GetOperation`
259
- # call of the `google::longrunning::Operations` service.
260
- # @!attribute [rw] annotation_results
261
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::VideoAnnotationResults>]
262
- # Annotation results for all videos specified in `AnnotateVideoRequest`.
263
- class AnnotateVideoResponse; end
264
-
265
- # Annotation progress for a single video.
266
- # @!attribute [rw] input_uri
267
- # @return [String]
268
- # Video file location in
269
- # [Google Cloud Storage](https://cloud.google.com/storage/).
270
- # @!attribute [rw] progress_percent
271
- # @return [Integer]
272
- # Approximate percentage processed thus far. Guaranteed to be
273
- # 100 when fully processed.
274
- # @!attribute [rw] start_time
275
- # @return [Google::Protobuf::Timestamp]
276
- # Time when the request was received.
277
- # @!attribute [rw] update_time
278
- # @return [Google::Protobuf::Timestamp]
279
- # Time of the most recent update.
280
- class VideoAnnotationProgress; end
281
-
282
- # Video annotation progress. Included in the `metadata`
283
- # field of the `Operation` returned by the `GetOperation`
284
- # call of the `google::longrunning::Operations` service.
285
- # @!attribute [rw] annotation_progress
286
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::VideoAnnotationProgress>]
287
- # Progress metadata for all videos specified in `AnnotateVideoRequest`.
288
- class AnnotateVideoProgress; end
289
-
290
- # A vertex represents a 2D point in the image.
291
- # NOTE: the normalized vertex coordinates are relative to the original image
292
- # and range from 0 to 1.
293
- # @!attribute [rw] x
294
- # @return [Float]
295
- # X coordinate.
296
- # @!attribute [rw] y
297
- # @return [Float]
298
- # Y coordinate.
299
- class NormalizedVertex; end
300
-
301
- # Normalized bounding polygon for text (that might not be aligned with axis).
302
- # Contains list of the corner points in clockwise order starting from
303
- # top-left corner. For example, for a rectangular bounding box:
304
- # When the text is horizontal it might look like:
305
- # 0----1
306
- # | |
307
- # 3----2
308
- #
309
- # When it's clockwise rotated 180 degrees around the top-left corner it
310
- # becomes:
311
- # 2----3
312
- # | |
313
- # 1----0
314
- #
315
- # and the vertex order will still be (0, 1, 2, 3). Note that values can be less
316
- # than 0, or greater than 1 due to trignometric calculations for location of
317
- # the box.
318
- # @!attribute [rw] vertices
319
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::NormalizedVertex>]
320
- # Normalized vertices of the bounding polygon.
321
- class NormalizedBoundingPoly; end
322
-
323
- # Video segment level annotation results for text detection.
324
- # @!attribute [rw] segment
325
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::VideoSegment]
326
- # Video segment where a text snippet was detected.
327
- # @!attribute [rw] confidence
328
- # @return [Float]
329
- # Confidence for the track of detected text. It is calculated as the highest
330
- # over all frames where OCR detected text appears.
331
- # @!attribute [rw] frames
332
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::TextFrame>]
333
- # Information related to the frames where OCR detected text appears.
334
- class TextSegment; end
335
-
336
- # Video frame level annotation results for text annotation (OCR).
337
- # Contains information regarding timestamp and bounding box locations for the
338
- # frames containing detected OCR text snippets.
339
- # @!attribute [rw] rotated_bounding_box
340
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::NormalizedBoundingPoly]
341
- # Bounding polygon of the detected text for this frame.
342
- # @!attribute [rw] time_offset
343
- # @return [Google::Protobuf::Duration]
344
- # Timestamp of this frame.
345
- class TextFrame; end
346
-
347
- # Annotations related to one detected OCR text snippet. This will contain the
348
- # corresponding text, confidence value, and frame level information for each
349
- # detection.
350
- # @!attribute [rw] text
351
- # @return [String]
352
- # The detected text.
353
- # @!attribute [rw] segments
354
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::TextSegment>]
355
- # All video segments where OCR detected text appears.
356
- class TextAnnotation; end
357
-
358
- # Video frame level annotations for object detection and tracking. This field
359
- # stores per frame location, time offset, and confidence.
360
- # @!attribute [rw] normalized_bounding_box
361
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::NormalizedBoundingBox]
362
- # The normalized bounding box location of this object track for the frame.
363
- # @!attribute [rw] time_offset
364
- # @return [Google::Protobuf::Duration]
365
- # The timestamp of the frame in microseconds.
366
- class ObjectTrackingFrame; end
367
-
368
- # Annotations corresponding to one tracked object.
369
- # @!attribute [rw] entity
370
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::Entity]
371
- # Entity to specify the object category that this track is labeled as.
372
- # @!attribute [rw] confidence
373
- # @return [Float]
374
- # Object category's labeling confidence of this track.
375
- # @!attribute [rw] frames
376
- # @return [Array<Google::Cloud::VideoIntelligence::V1p2beta1::ObjectTrackingFrame>]
377
- # Information corresponding to all frames where this object track appears.
378
- # @!attribute [rw] segment
379
- # @return [Google::Cloud::VideoIntelligence::V1p2beta1::VideoSegment]
380
- # Each object track corresponds to one video segment where it appears.
381
- class ObjectTrackingAnnotation; end
382
-
383
- # Video annotation feature.
384
- module Feature
385
- # Unspecified.
386
- FEATURE_UNSPECIFIED = 0
387
-
388
- # Label detection. Detect objects, such as dog or flower.
389
- LABEL_DETECTION = 1
390
-
391
- # Shot change detection.
392
- SHOT_CHANGE_DETECTION = 2
393
-
394
- # Explicit content detection.
395
- EXPLICIT_CONTENT_DETECTION = 3
396
-
397
- # OCR text detection and tracking.
398
- TEXT_DETECTION = 7
399
-
400
- # Object detection and tracking.
401
- OBJECT_TRACKING = 9
402
- end
403
-
404
- # Label detection mode.
405
- module LabelDetectionMode
406
- # Unspecified.
407
- LABEL_DETECTION_MODE_UNSPECIFIED = 0
408
-
409
- # Detect shot-level labels.
410
- SHOT_MODE = 1
411
-
412
- # Detect frame-level labels.
413
- FRAME_MODE = 2
414
-
415
- # Detect both shot-level and frame-level labels.
416
- SHOT_AND_FRAME_MODE = 3
417
- end
418
-
419
- # Bucketized representation of likelihood.
420
- module Likelihood
421
- # Unspecified likelihood.
422
- LIKELIHOOD_UNSPECIFIED = 0
423
-
424
- # Very unlikely.
425
- VERY_UNLIKELY = 1
426
-
427
- # Unlikely.
428
- UNLIKELY = 2
429
-
430
- # Possible.
431
- POSSIBLE = 3
432
-
433
- # Likely.
434
- LIKELY = 4
435
-
436
- # Very likely.
437
- VERY_LIKELY = 5
438
- end
439
- end
440
- end
441
- end
442
- end