google-cloud-video_intelligence 2.1.1 → 3.1.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 +201 -0
  5. data/MIGRATING.md +274 -0
  6. data/README.md +97 -64
  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 +100 -84
  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.v1beta2.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": 60000,
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/v1p1beta1/video_intelligence_service_client"
17
- require "google/rpc/status_pb"
18
- require "google/cloud/videointelligence/v1p1beta1/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: :v1p1beta1)
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 V1p1beta1
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::V1p1beta1::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 V1p1beta1
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,410 +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 V1p1beta1
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::V1p1beta1::Feature>]
40
- # Required. Requested video annotation features.
41
- # @!attribute [rw] video_context
42
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::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::V1p1beta1::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::V1p1beta1::LabelDetectionConfig]
67
- # Config for LABEL_DETECTION.
68
- # @!attribute [rw] shot_change_detection_config
69
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::ShotChangeDetectionConfig]
70
- # Config for SHOT_CHANGE_DETECTION.
71
- # @!attribute [rw] explicit_content_detection_config
72
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::ExplicitContentDetectionConfig]
73
- # Config for EXPLICIT_CONTENT_DETECTION.
74
- # @!attribute [rw] speech_transcription_config
75
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::SpeechTranscriptionConfig]
76
- # Config for SPEECH_TRANSCRIPTION.
77
- class VideoContext; end
78
-
79
- # Config for LABEL_DETECTION.
80
- # @!attribute [rw] label_detection_mode
81
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::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
- # Video segment.
114
- # @!attribute [rw] start_time_offset
115
- # @return [Google::Protobuf::Duration]
116
- # Time-offset, relative to the beginning of the video,
117
- # corresponding to the start of the segment (inclusive).
118
- # @!attribute [rw] end_time_offset
119
- # @return [Google::Protobuf::Duration]
120
- # Time-offset, relative to the beginning of the video,
121
- # corresponding to the end of the segment (inclusive).
122
- class VideoSegment; end
123
-
124
- # Video segment level annotation results for label detection.
125
- # @!attribute [rw] segment
126
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::VideoSegment]
127
- # Video segment where a label was detected.
128
- # @!attribute [rw] confidence
129
- # @return [Float]
130
- # Confidence that the label is accurate. Range: [0, 1].
131
- class LabelSegment; end
132
-
133
- # Video frame level annotation results for label detection.
134
- # @!attribute [rw] time_offset
135
- # @return [Google::Protobuf::Duration]
136
- # Time-offset, relative to the beginning of the video, corresponding to the
137
- # video frame for this location.
138
- # @!attribute [rw] confidence
139
- # @return [Float]
140
- # Confidence that the label is accurate. Range: [0, 1].
141
- class LabelFrame; end
142
-
143
- # Detected entity from video analysis.
144
- # @!attribute [rw] entity_id
145
- # @return [String]
146
- # Opaque entity ID. Some IDs may be available in
147
- # [Google Knowledge Graph Search
148
- # API](https://developers.google.com/knowledge-graph/).
149
- # @!attribute [rw] description
150
- # @return [String]
151
- # Textual description, e.g. `Fixed-gear bicycle`.
152
- # @!attribute [rw] language_code
153
- # @return [String]
154
- # Language code for `description` in BCP-47 format.
155
- class Entity; end
156
-
157
- # Label annotation.
158
- # @!attribute [rw] entity
159
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::Entity]
160
- # Detected entity.
161
- # @!attribute [rw] category_entities
162
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::Entity>]
163
- # Common categories for the detected entity.
164
- # E.g. when the label is `Terrier` the category is likely `dog`. And in some
165
- # cases there might be more than one categories e.g. `Terrier` could also be
166
- # a `pet`.
167
- # @!attribute [rw] segments
168
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::LabelSegment>]
169
- # All video segments where a label was detected.
170
- # @!attribute [rw] frames
171
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::LabelFrame>]
172
- # All video frames where a label was detected.
173
- class LabelAnnotation; end
174
-
175
- # Video frame level annotation results for explicit content.
176
- # @!attribute [rw] time_offset
177
- # @return [Google::Protobuf::Duration]
178
- # Time-offset, relative to the beginning of the video, corresponding to the
179
- # video frame for this location.
180
- # @!attribute [rw] pornography_likelihood
181
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::Likelihood]
182
- # Likelihood of the pornography content..
183
- class ExplicitContentFrame; end
184
-
185
- # Explicit content annotation (based on per-frame visual signals only).
186
- # If no explicit content has been detected in a frame, no annotations are
187
- # present for that frame.
188
- # @!attribute [rw] frames
189
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::ExplicitContentFrame>]
190
- # All video frames where explicit content was detected.
191
- class ExplicitContentAnnotation; end
192
-
193
- # Annotation results for a single video.
194
- # @!attribute [rw] input_uri
195
- # @return [String]
196
- # Output only. Video file location in
197
- # [Google Cloud Storage](https://cloud.google.com/storage/).
198
- # @!attribute [rw] segment_label_annotations
199
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::LabelAnnotation>]
200
- # Label annotations on video level or user specified segment level.
201
- # There is exactly one element for each unique label.
202
- # @!attribute [rw] shot_label_annotations
203
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::LabelAnnotation>]
204
- # Label annotations on shot level.
205
- # There is exactly one element for each unique label.
206
- # @!attribute [rw] frame_label_annotations
207
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::LabelAnnotation>]
208
- # Label annotations on frame level.
209
- # There is exactly one element for each unique label.
210
- # @!attribute [rw] shot_annotations
211
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::VideoSegment>]
212
- # Shot annotations. Each shot is represented as a video segment.
213
- # @!attribute [rw] explicit_annotation
214
- # @return [Google::Cloud::VideoIntelligence::V1p1beta1::ExplicitContentAnnotation]
215
- # Explicit content annotation.
216
- # @!attribute [rw] speech_transcriptions
217
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::SpeechTranscription>]
218
- # Speech transcription.
219
- # @!attribute [rw] error
220
- # @return [Google::Rpc::Status]
221
- # Output only. If set, indicates an error. Note that for a single
222
- # `AnnotateVideoRequest` some videos may succeed and some may fail.
223
- class VideoAnnotationResults; end
224
-
225
- # Video annotation response. Included in the `response`
226
- # field of the `Operation` returned by the `GetOperation`
227
- # call of the `google::longrunning::Operations` service.
228
- # @!attribute [rw] annotation_results
229
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::VideoAnnotationResults>]
230
- # Annotation results for all videos specified in `AnnotateVideoRequest`.
231
- class AnnotateVideoResponse; end
232
-
233
- # Annotation progress for a single video.
234
- # @!attribute [rw] input_uri
235
- # @return [String]
236
- # Output only. Video file location in
237
- # [Google Cloud Storage](https://cloud.google.com/storage/).
238
- # @!attribute [rw] progress_percent
239
- # @return [Integer]
240
- # Output only. Approximate percentage processed thus far. Guaranteed to be
241
- # 100 when fully processed.
242
- # @!attribute [rw] start_time
243
- # @return [Google::Protobuf::Timestamp]
244
- # Output only. Time when the request was received.
245
- # @!attribute [rw] update_time
246
- # @return [Google::Protobuf::Timestamp]
247
- # Output only. Time of the most recent update.
248
- class VideoAnnotationProgress; end
249
-
250
- # Video annotation progress. Included in the `metadata`
251
- # field of the `Operation` returned by the `GetOperation`
252
- # call of the `google::longrunning::Operations` service.
253
- # @!attribute [rw] annotation_progress
254
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::VideoAnnotationProgress>]
255
- # Progress metadata for all videos specified in `AnnotateVideoRequest`.
256
- class AnnotateVideoProgress; end
257
-
258
- # Config for SPEECH_TRANSCRIPTION.
259
- # @!attribute [rw] language_code
260
- # @return [String]
261
- # Required. *Required* The language of the supplied audio as a
262
- # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
263
- # Example: "en-US".
264
- # See [Language Support](https://cloud.google.com/speech/docs/languages)
265
- # for a list of the currently supported language codes.
266
- # @!attribute [rw] max_alternatives
267
- # @return [Integer]
268
- # Optional. Maximum number of recognition hypotheses to be returned.
269
- # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
270
- # within each `SpeechTranscription`. The server may return fewer than
271
- # `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will
272
- # return a maximum of one. If omitted, will return a maximum of one.
273
- # @!attribute [rw] filter_profanity
274
- # @return [true, false]
275
- # Optional. If set to `true`, the server will attempt to filter out
276
- # profanities, replacing all but the initial character in each filtered word
277
- # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
278
- # won't be filtered out.
279
- # @!attribute [rw] speech_contexts
280
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::SpeechContext>]
281
- # Optional. A means to provide context to assist the speech recognition.
282
- # @!attribute [rw] enable_automatic_punctuation
283
- # @return [true, false]
284
- # Optional. If 'true', adds punctuation to recognition result hypotheses.
285
- # This feature is only available in select languages. Setting this for
286
- # requests in other languages has no effect at all. The default 'false' value
287
- # does not add punctuation to result hypotheses. NOTE: "This is currently
288
- # offered as an experimental service, complimentary to all users. In the
289
- # future this may be exclusively available as a premium feature."
290
- # @!attribute [rw] audio_tracks
291
- # @return [Array<Integer>]
292
- # Optional. For file formats, such as MXF or MKV, supporting multiple audio
293
- # tracks, specify up to two tracks. Default: track 0.
294
- class SpeechTranscriptionConfig; end
295
-
296
- # Provides "hints" to the speech recognizer to favor specific words and phrases
297
- # in the results.
298
- # @!attribute [rw] phrases
299
- # @return [Array<String>]
300
- # Optional. A list of strings containing words and phrases "hints" so that
301
- # the speech recognition is more likely to recognize them. This can be used
302
- # to improve the accuracy for specific words and phrases, for example, if
303
- # specific commands are typically spoken by the user. This can also be used
304
- # to add additional words to the vocabulary of the recognizer. See
305
- # [usage limits](https://cloud.google.com/speech/limits#content).
306
- class SpeechContext; end
307
-
308
- # A speech recognition result corresponding to a portion of the audio.
309
- # @!attribute [rw] alternatives
310
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::SpeechRecognitionAlternative>]
311
- # May contain one or more recognition hypotheses (up to the maximum specified
312
- # in `max_alternatives`). These alternatives are ordered in terms of
313
- # accuracy, with the top (first) alternative being the most probable, as
314
- # ranked by the recognizer.
315
- class SpeechTranscription; end
316
-
317
- # Alternative hypotheses (a.k.a. n-best list).
318
- # @!attribute [rw] transcript
319
- # @return [String]
320
- # Output only. Transcript text representing the words that the user spoke.
321
- # @!attribute [rw] confidence
322
- # @return [Float]
323
- # Output only. The confidence estimate between 0.0 and 1.0. A higher number
324
- # indicates an estimated greater likelihood that the recognized words are
325
- # correct. This field is set only for the top alternative.
326
- # This field is not guaranteed to be accurate and users should not rely on it
327
- # to be always provided.
328
- # The default of 0.0 is a sentinel value indicating `confidence` was not set.
329
- # @!attribute [rw] words
330
- # @return [Array<Google::Cloud::VideoIntelligence::V1p1beta1::WordInfo>]
331
- # Output only. A list of word-specific information for each recognized word.
332
- class SpeechRecognitionAlternative; end
333
-
334
- # Word-specific information for recognized words. Word information is only
335
- # included in the response when certain request parameters are set, such
336
- # as `enable_word_time_offsets`.
337
- # @!attribute [rw] start_time
338
- # @return [Google::Protobuf::Duration]
339
- # Output only. Time offset relative to the beginning of the audio, and
340
- # corresponding to the start of the spoken word. This field is only set if
341
- # `enable_word_time_offsets=true` and only in the top hypothesis. This is an
342
- # experimental feature and the accuracy of the time offset can vary.
343
- # @!attribute [rw] end_time
344
- # @return [Google::Protobuf::Duration]
345
- # Output only. Time offset relative to the beginning of the audio, and
346
- # corresponding to the end of the spoken word. This field is only set if
347
- # `enable_word_time_offsets=true` and only in the top hypothesis. This is an
348
- # experimental feature and the accuracy of the time offset can vary.
349
- # @!attribute [rw] word
350
- # @return [String]
351
- # Output only. The word corresponding to this set of information.
352
- class WordInfo; end
353
-
354
- # Video annotation feature.
355
- module Feature
356
- # Unspecified.
357
- FEATURE_UNSPECIFIED = 0
358
-
359
- # Label detection. Detect objects, such as dog or flower.
360
- LABEL_DETECTION = 1
361
-
362
- # Shot change detection.
363
- SHOT_CHANGE_DETECTION = 2
364
-
365
- # Explicit content detection.
366
- EXPLICIT_CONTENT_DETECTION = 3
367
-
368
- # Speech transcription.
369
- SPEECH_TRANSCRIPTION = 6
370
- end
371
-
372
- # Label detection mode.
373
- module LabelDetectionMode
374
- # Unspecified.
375
- LABEL_DETECTION_MODE_UNSPECIFIED = 0
376
-
377
- # Detect shot-level labels.
378
- SHOT_MODE = 1
379
-
380
- # Detect frame-level labels.
381
- FRAME_MODE = 2
382
-
383
- # Detect both shot-level and frame-level labels.
384
- SHOT_AND_FRAME_MODE = 3
385
- end
386
-
387
- # Bucketized representation of likelihood.
388
- module Likelihood
389
- # Unspecified likelihood.
390
- LIKELIHOOD_UNSPECIFIED = 0
391
-
392
- # Very unlikely.
393
- VERY_UNLIKELY = 1
394
-
395
- # Unlikely.
396
- UNLIKELY = 2
397
-
398
- # Possible.
399
- POSSIBLE = 3
400
-
401
- # Likely.
402
- LIKELY = 4
403
-
404
- # Very likely.
405
- VERY_LIKELY = 5
406
- end
407
- end
408
- end
409
- end
410
- end