gcp_client/google/cloud/videointelligence/v1p3beta1.rs
1/// Video annotation request.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct AnnotateVideoRequest {
4 /// Input video location. Currently, only
5 /// [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
6 /// supported, which must be specified in the following format:
7 /// `gs://bucket-id/object-id` (other URI formats return
8 /// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
9 /// more information, see [Request URIs](https://cloud.google.com/storage/docs/request-endpoints). A video
10 /// URI may include wildcards in `object-id`, and thus identify multiple
11 /// videos. Supported wildcards: '*' to match 0 or more characters;
12 /// '?' to match 1 character. If unset, the input video should be embedded
13 /// in the request as `input_content`. If set, `input_content` should be unset.
14 #[prost(string, tag="1")]
15 pub input_uri: std::string::String,
16 /// The video data bytes.
17 /// If unset, the input video(s) should be specified via `input_uri`.
18 /// If set, `input_uri` should be unset.
19 #[prost(bytes, tag="6")]
20 pub input_content: std::vec::Vec<u8>,
21 /// Required. Requested video annotation features.
22 #[prost(enumeration="Feature", repeated, packed="false", tag="2")]
23 pub features: ::std::vec::Vec<i32>,
24 /// Additional video context and/or feature-specific parameters.
25 #[prost(message, optional, tag="3")]
26 pub video_context: ::std::option::Option<VideoContext>,
27 /// Optional. Location where the output (in JSON format) should be stored.
28 /// Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
29 /// URIs are supported, which must be specified in the following format:
30 /// `gs://bucket-id/object-id` (other URI formats return
31 /// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
32 /// more information, see [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
33 #[prost(string, tag="4")]
34 pub output_uri: std::string::String,
35 /// Optional. Cloud region where annotation should take place. Supported cloud
36 /// regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
37 /// is specified, a region will be determined based on video file location.
38 #[prost(string, tag="5")]
39 pub location_id: std::string::String,
40}
41/// Video context and/or feature-specific parameters.
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct VideoContext {
44 /// Video segments to annotate. The segments may overlap and are not required
45 /// to be contiguous or span the whole video. If unspecified, each video is
46 /// treated as a single segment.
47 #[prost(message, repeated, tag="1")]
48 pub segments: ::std::vec::Vec<VideoSegment>,
49 /// Config for LABEL_DETECTION.
50 #[prost(message, optional, tag="2")]
51 pub label_detection_config: ::std::option::Option<LabelDetectionConfig>,
52 /// Config for SHOT_CHANGE_DETECTION.
53 #[prost(message, optional, tag="3")]
54 pub shot_change_detection_config: ::std::option::Option<ShotChangeDetectionConfig>,
55 /// Config for EXPLICIT_CONTENT_DETECTION.
56 #[prost(message, optional, tag="4")]
57 pub explicit_content_detection_config: ::std::option::Option<ExplicitContentDetectionConfig>,
58 /// Config for FACE_DETECTION.
59 #[prost(message, optional, tag="5")]
60 pub face_detection_config: ::std::option::Option<FaceDetectionConfig>,
61 /// Config for SPEECH_TRANSCRIPTION.
62 #[prost(message, optional, tag="6")]
63 pub speech_transcription_config: ::std::option::Option<SpeechTranscriptionConfig>,
64 /// Config for TEXT_DETECTION.
65 #[prost(message, optional, tag="8")]
66 pub text_detection_config: ::std::option::Option<TextDetectionConfig>,
67 /// Config for PERSON_DETECTION.
68 #[prost(message, optional, tag="11")]
69 pub person_detection_config: ::std::option::Option<PersonDetectionConfig>,
70 /// Config for OBJECT_TRACKING.
71 #[prost(message, optional, tag="13")]
72 pub object_tracking_config: ::std::option::Option<ObjectTrackingConfig>,
73}
74/// Config for LABEL_DETECTION.
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct LabelDetectionConfig {
77 /// What labels should be detected with LABEL_DETECTION, in addition to
78 /// video-level labels or segment-level labels.
79 /// If unspecified, defaults to `SHOT_MODE`.
80 #[prost(enumeration="LabelDetectionMode", tag="1")]
81 pub label_detection_mode: i32,
82 /// Whether the video has been shot from a stationary (i.e. non-moving) camera.
83 /// When set to true, might improve detection accuracy for moving objects.
84 /// Should be used with `SHOT_AND_FRAME_MODE` enabled.
85 #[prost(bool, tag="2")]
86 pub stationary_camera: bool,
87 /// Model to use for label detection.
88 /// Supported values: "builtin/stable" (the default if unset) and
89 /// "builtin/latest".
90 #[prost(string, tag="3")]
91 pub model: std::string::String,
92 /// The confidence threshold we perform filtering on the labels from
93 /// frame-level detection. If not set, it is set to 0.4 by default. The valid
94 /// range for this threshold is [0.1, 0.9]. Any value set outside of this
95 /// range will be clipped.
96 /// Note: for best results please follow the default threshold. We will update
97 /// the default threshold everytime when we release a new model.
98 #[prost(float, tag="4")]
99 pub frame_confidence_threshold: f32,
100 /// The confidence threshold we perform filtering on the labels from
101 /// video-level and shot-level detections. If not set, it is set to 0.3 by
102 /// default. The valid range for this threshold is [0.1, 0.9]. Any value set
103 /// outside of this range will be clipped.
104 /// Note: for best results please follow the default threshold. We will update
105 /// the default threshold everytime when we release a new model.
106 #[prost(float, tag="5")]
107 pub video_confidence_threshold: f32,
108}
109/// Config for SHOT_CHANGE_DETECTION.
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct ShotChangeDetectionConfig {
112 /// Model to use for shot change detection.
113 /// Supported values: "builtin/stable" (the default if unset) and
114 /// "builtin/latest".
115 #[prost(string, tag="1")]
116 pub model: std::string::String,
117}
118/// Config for OBJECT_TRACKING.
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct ObjectTrackingConfig {
121 /// Model to use for object tracking.
122 /// Supported values: "builtin/stable" (the default if unset) and
123 /// "builtin/latest".
124 #[prost(string, tag="1")]
125 pub model: std::string::String,
126}
127/// Config for EXPLICIT_CONTENT_DETECTION.
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct ExplicitContentDetectionConfig {
130 /// Model to use for explicit content detection.
131 /// Supported values: "builtin/stable" (the default if unset) and
132 /// "builtin/latest".
133 #[prost(string, tag="1")]
134 pub model: std::string::String,
135}
136/// Config for FACE_DETECTION.
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct FaceDetectionConfig {
139 /// Model to use for face detection.
140 /// Supported values: "builtin/stable" (the default if unset) and
141 /// "builtin/latest".
142 #[prost(string, tag="1")]
143 pub model: std::string::String,
144 /// Whether bounding boxes be included in the face annotation output.
145 #[prost(bool, tag="2")]
146 pub include_bounding_boxes: bool,
147 /// Whether to enable face attributes detection, such as glasses, dark_glasses,
148 /// mouth_open etc. Ignored if 'include_bounding_boxes' is false.
149 #[prost(bool, tag="5")]
150 pub include_attributes: bool,
151}
152/// Config for PERSON_DETECTION.
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct PersonDetectionConfig {
155 /// Whether bounding boxes be included in the person detection annotation
156 /// output.
157 #[prost(bool, tag="1")]
158 pub include_bounding_boxes: bool,
159 /// Whether to enable pose landmarks detection. Ignored if
160 /// 'include_bounding_boxes' is false.
161 #[prost(bool, tag="2")]
162 pub include_pose_landmarks: bool,
163 /// Whether to enable person attributes detection, such as cloth color (black,
164 /// blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair
165 /// color (black, blonde, etc), hair length (long, short, bald), etc.
166 /// Ignored if 'include_bounding_boxes' is false.
167 #[prost(bool, tag="3")]
168 pub include_attributes: bool,
169}
170/// Config for TEXT_DETECTION.
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct TextDetectionConfig {
173 /// Language hint can be specified if the language to be detected is known a
174 /// priori. It can increase the accuracy of the detection. Language hint must
175 /// be language code in BCP-47 format.
176 ///
177 /// Automatic language detection is performed if no hint is provided.
178 #[prost(string, repeated, tag="1")]
179 pub language_hints: ::std::vec::Vec<std::string::String>,
180 /// Model to use for text detection.
181 /// Supported values: "builtin/stable" (the default if unset) and
182 /// "builtin/latest".
183 #[prost(string, tag="2")]
184 pub model: std::string::String,
185}
186/// Video segment.
187#[derive(Clone, PartialEq, ::prost::Message)]
188pub struct VideoSegment {
189 /// Time-offset, relative to the beginning of the video,
190 /// corresponding to the start of the segment (inclusive).
191 #[prost(message, optional, tag="1")]
192 pub start_time_offset: ::std::option::Option<::prost_types::Duration>,
193 /// Time-offset, relative to the beginning of the video,
194 /// corresponding to the end of the segment (inclusive).
195 #[prost(message, optional, tag="2")]
196 pub end_time_offset: ::std::option::Option<::prost_types::Duration>,
197}
198/// Video segment level annotation results for label detection.
199#[derive(Clone, PartialEq, ::prost::Message)]
200pub struct LabelSegment {
201 /// Video segment where a label was detected.
202 #[prost(message, optional, tag="1")]
203 pub segment: ::std::option::Option<VideoSegment>,
204 /// Confidence that the label is accurate. Range: [0, 1].
205 #[prost(float, tag="2")]
206 pub confidence: f32,
207}
208/// Video frame level annotation results for label detection.
209#[derive(Clone, PartialEq, ::prost::Message)]
210pub struct LabelFrame {
211 /// Time-offset, relative to the beginning of the video, corresponding to the
212 /// video frame for this location.
213 #[prost(message, optional, tag="1")]
214 pub time_offset: ::std::option::Option<::prost_types::Duration>,
215 /// Confidence that the label is accurate. Range: [0, 1].
216 #[prost(float, tag="2")]
217 pub confidence: f32,
218}
219/// Detected entity from video analysis.
220#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct Entity {
222 /// Opaque entity ID. Some IDs may be available in
223 /// [Google Knowledge Graph Search
224 /// API](https://developers.google.com/knowledge-graph/).
225 #[prost(string, tag="1")]
226 pub entity_id: std::string::String,
227 /// Textual description, e.g. `Fixed-gear bicycle`.
228 #[prost(string, tag="2")]
229 pub description: std::string::String,
230 /// Language code for `description` in BCP-47 format.
231 #[prost(string, tag="3")]
232 pub language_code: std::string::String,
233}
234/// Label annotation.
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct LabelAnnotation {
237 /// Detected entity.
238 #[prost(message, optional, tag="1")]
239 pub entity: ::std::option::Option<Entity>,
240 /// Common categories for the detected entity.
241 /// E.g. when the label is `Terrier` the category is likely `dog`. And in some
242 /// cases there might be more than one categories e.g. `Terrier` could also be
243 /// a `pet`.
244 #[prost(message, repeated, tag="2")]
245 pub category_entities: ::std::vec::Vec<Entity>,
246 /// All video segments where a label was detected.
247 #[prost(message, repeated, tag="3")]
248 pub segments: ::std::vec::Vec<LabelSegment>,
249 /// All video frames where a label was detected.
250 #[prost(message, repeated, tag="4")]
251 pub frames: ::std::vec::Vec<LabelFrame>,
252}
253/// Video frame level annotation results for explicit content.
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct ExplicitContentFrame {
256 /// Time-offset, relative to the beginning of the video, corresponding to the
257 /// video frame for this location.
258 #[prost(message, optional, tag="1")]
259 pub time_offset: ::std::option::Option<::prost_types::Duration>,
260 /// Likelihood of the pornography content..
261 #[prost(enumeration="Likelihood", tag="2")]
262 pub pornography_likelihood: i32,
263}
264/// Explicit content annotation (based on per-frame visual signals only).
265/// If no explicit content has been detected in a frame, no annotations are
266/// present for that frame.
267#[derive(Clone, PartialEq, ::prost::Message)]
268pub struct ExplicitContentAnnotation {
269 /// All video frames where explicit content was detected.
270 #[prost(message, repeated, tag="1")]
271 pub frames: ::std::vec::Vec<ExplicitContentFrame>,
272}
273/// Normalized bounding box.
274/// The normalized vertex coordinates are relative to the original image.
275/// Range: [0, 1].
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct NormalizedBoundingBox {
278 /// Left X coordinate.
279 #[prost(float, tag="1")]
280 pub left: f32,
281 /// Top Y coordinate.
282 #[prost(float, tag="2")]
283 pub top: f32,
284 /// Right X coordinate.
285 #[prost(float, tag="3")]
286 pub right: f32,
287 /// Bottom Y coordinate.
288 #[prost(float, tag="4")]
289 pub bottom: f32,
290}
291/// For tracking related features.
292/// An object at time_offset with attributes, and located with
293/// normalized_bounding_box.
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct TimestampedObject {
296 /// Normalized Bounding box in a frame, where the object is located.
297 #[prost(message, optional, tag="1")]
298 pub normalized_bounding_box: ::std::option::Option<NormalizedBoundingBox>,
299 /// Time-offset, relative to the beginning of the video,
300 /// corresponding to the video frame for this object.
301 #[prost(message, optional, tag="2")]
302 pub time_offset: ::std::option::Option<::prost_types::Duration>,
303 /// Optional. The attributes of the object in the bounding box.
304 #[prost(message, repeated, tag="3")]
305 pub attributes: ::std::vec::Vec<DetectedAttribute>,
306 /// Optional. The detected landmarks.
307 #[prost(message, repeated, tag="4")]
308 pub landmarks: ::std::vec::Vec<DetectedLandmark>,
309}
310/// A track of an object instance.
311#[derive(Clone, PartialEq, ::prost::Message)]
312pub struct Track {
313 /// Video segment of a track.
314 #[prost(message, optional, tag="1")]
315 pub segment: ::std::option::Option<VideoSegment>,
316 /// The object with timestamp and attributes per frame in the track.
317 #[prost(message, repeated, tag="2")]
318 pub timestamped_objects: ::std::vec::Vec<TimestampedObject>,
319 /// Optional. Attributes in the track level.
320 #[prost(message, repeated, tag="3")]
321 pub attributes: ::std::vec::Vec<DetectedAttribute>,
322 /// Optional. The confidence score of the tracked object.
323 #[prost(float, tag="4")]
324 pub confidence: f32,
325}
326/// A generic detected attribute represented by name in string format.
327#[derive(Clone, PartialEq, ::prost::Message)]
328pub struct DetectedAttribute {
329 /// The name of the attribute, i.e. glasses, dark_glasses, mouth_open etc.
330 /// A full list of supported type names will be provided in the document.
331 #[prost(string, tag="1")]
332 pub name: std::string::String,
333 /// Detected attribute confidence. Range [0, 1].
334 #[prost(float, tag="2")]
335 pub confidence: f32,
336 /// Text value of the detection result. For example, the value for "HairColor"
337 /// can be "black", "blonde", etc.
338 #[prost(string, tag="3")]
339 pub value: std::string::String,
340}
341/// Celebrity definition.
342#[derive(Clone, PartialEq, ::prost::Message)]
343pub struct Celebrity {
344 /// The resource name of the celebrity. Have the format
345 /// `video-intelligence/kg-mid` indicates a celebrity from preloaded gallery.
346 /// kg-mid is the id in Google knowledge graph, which is unique for the
347 /// celebrity.
348 #[prost(string, tag="1")]
349 pub name: std::string::String,
350 /// The celebrity name.
351 #[prost(string, tag="2")]
352 pub display_name: std::string::String,
353 /// Textual description of additional information about the celebrity, if
354 /// applicable.
355 #[prost(string, tag="3")]
356 pub description: std::string::String,
357}
358/// The annotation result of a celebrity face track. RecognizedCelebrity field
359/// could be empty if the face track does not have any matched celebrities.
360#[derive(Clone, PartialEq, ::prost::Message)]
361pub struct CelebrityTrack {
362 /// Top N match of the celebrities for the face in this track.
363 #[prost(message, repeated, tag="1")]
364 pub celebrities: ::std::vec::Vec<celebrity_track::RecognizedCelebrity>,
365 /// A track of a person's face.
366 #[prost(message, optional, tag="3")]
367 pub face_track: ::std::option::Option<Track>,
368}
369pub mod celebrity_track {
370 /// The recognized celebrity with confidence score.
371 #[derive(Clone, PartialEq, ::prost::Message)]
372 pub struct RecognizedCelebrity {
373 /// The recognized celebrity.
374 #[prost(message, optional, tag="1")]
375 pub celebrity: ::std::option::Option<super::Celebrity>,
376 /// Recognition confidence. Range [0, 1].
377 #[prost(float, tag="2")]
378 pub confidence: f32,
379 }
380}
381/// Celebrity recognition annotation per video.
382#[derive(Clone, PartialEq, ::prost::Message)]
383pub struct CelebrityRecognitionAnnotation {
384 /// The tracks detected from the input video, including recognized celebrities
385 /// and other detected faces in the video.
386 #[prost(message, repeated, tag="1")]
387 pub celebrity_tracks: ::std::vec::Vec<CelebrityTrack>,
388}
389/// A generic detected landmark represented by name in string format and a 2D
390/// location.
391#[derive(Clone, PartialEq, ::prost::Message)]
392pub struct DetectedLandmark {
393 /// The name of this landmark, i.e. left_hand, right_shoulder.
394 #[prost(string, tag="1")]
395 pub name: std::string::String,
396 /// The 2D point of the detected landmark using the normalized image
397 /// coordindate system. The normalized coordinates have the range from 0 to 1.
398 #[prost(message, optional, tag="2")]
399 pub point: ::std::option::Option<NormalizedVertex>,
400 /// The confidence score of the detected landmark. Range [0, 1].
401 #[prost(float, tag="3")]
402 pub confidence: f32,
403}
404/// Face detection annotation.
405#[derive(Clone, PartialEq, ::prost::Message)]
406pub struct FaceDetectionAnnotation {
407 /// The face tracks with attributes.
408 #[prost(message, repeated, tag="3")]
409 pub tracks: ::std::vec::Vec<Track>,
410 /// The thumbnail of a person's face.
411 #[prost(bytes, tag="4")]
412 pub thumbnail: std::vec::Vec<u8>,
413}
414/// Person detection annotation per video.
415#[derive(Clone, PartialEq, ::prost::Message)]
416pub struct PersonDetectionAnnotation {
417 /// The trackes that a person is detected.
418 #[prost(message, repeated, tag="1")]
419 pub tracks: ::std::vec::Vec<Track>,
420}
421/// Annotation results for a single video.
422#[derive(Clone, PartialEq, ::prost::Message)]
423pub struct VideoAnnotationResults {
424 /// Video file location in
425 /// [Google Cloud Storage](https://cloud.google.com/storage/).
426 #[prost(string, tag="1")]
427 pub input_uri: std::string::String,
428 /// Video segment on which the annotation is run.
429 #[prost(message, optional, tag="10")]
430 pub segment: ::std::option::Option<VideoSegment>,
431 /// Topical label annotations on video level or user specified segment level.
432 /// There is exactly one element for each unique label.
433 #[prost(message, repeated, tag="2")]
434 pub segment_label_annotations: ::std::vec::Vec<LabelAnnotation>,
435 /// Presence label annotations on video level or user specified segment level.
436 /// There is exactly one element for each unique label. Compared to the
437 /// existing topical `segment_label_annotations`, this field presents more
438 /// fine-grained, segment-level labels detected in video content and is made
439 /// available only when the client sets `LabelDetectionConfig.model` to
440 /// "builtin/latest" in the request.
441 #[prost(message, repeated, tag="23")]
442 pub segment_presence_label_annotations: ::std::vec::Vec<LabelAnnotation>,
443 /// Topical label annotations on shot level.
444 /// There is exactly one element for each unique label.
445 #[prost(message, repeated, tag="3")]
446 pub shot_label_annotations: ::std::vec::Vec<LabelAnnotation>,
447 /// Presence label annotations on shot level. There is exactly one element for
448 /// each unique label. Compared to the existing topical
449 /// `shot_label_annotations`, this field presents more fine-grained, shot-level
450 /// labels detected in video content and is made available only when the client
451 /// sets `LabelDetectionConfig.model` to "builtin/latest" in the request.
452 #[prost(message, repeated, tag="24")]
453 pub shot_presence_label_annotations: ::std::vec::Vec<LabelAnnotation>,
454 /// Label annotations on frame level.
455 /// There is exactly one element for each unique label.
456 #[prost(message, repeated, tag="4")]
457 pub frame_label_annotations: ::std::vec::Vec<LabelAnnotation>,
458 /// Face detection annotations.
459 #[prost(message, repeated, tag="13")]
460 pub face_detection_annotations: ::std::vec::Vec<FaceDetectionAnnotation>,
461 /// Shot annotations. Each shot is represented as a video segment.
462 #[prost(message, repeated, tag="6")]
463 pub shot_annotations: ::std::vec::Vec<VideoSegment>,
464 /// Explicit content annotation.
465 #[prost(message, optional, tag="7")]
466 pub explicit_annotation: ::std::option::Option<ExplicitContentAnnotation>,
467 /// Speech transcription.
468 #[prost(message, repeated, tag="11")]
469 pub speech_transcriptions: ::std::vec::Vec<SpeechTranscription>,
470 /// OCR text detection and tracking.
471 /// Annotations for list of detected text snippets. Each will have list of
472 /// frame information associated with it.
473 #[prost(message, repeated, tag="12")]
474 pub text_annotations: ::std::vec::Vec<TextAnnotation>,
475 /// Annotations for list of objects detected and tracked in video.
476 #[prost(message, repeated, tag="14")]
477 pub object_annotations: ::std::vec::Vec<ObjectTrackingAnnotation>,
478 /// Annotations for list of logos detected, tracked and recognized in video.
479 #[prost(message, repeated, tag="19")]
480 pub logo_recognition_annotations: ::std::vec::Vec<LogoRecognitionAnnotation>,
481 /// Person detection annotations.
482 #[prost(message, repeated, tag="20")]
483 pub person_detection_annotations: ::std::vec::Vec<PersonDetectionAnnotation>,
484 /// Celebrity recognition annotations.
485 #[prost(message, optional, tag="21")]
486 pub celebrity_recognition_annotations: ::std::option::Option<CelebrityRecognitionAnnotation>,
487 /// If set, indicates an error. Note that for a single `AnnotateVideoRequest`
488 /// some videos may succeed and some may fail.
489 #[prost(message, optional, tag="9")]
490 pub error: ::std::option::Option<super::super::super::rpc::Status>,
491}
492/// Video annotation response. Included in the `response`
493/// field of the `Operation` returned by the `GetOperation`
494/// call of the `google::longrunning::Operations` service.
495#[derive(Clone, PartialEq, ::prost::Message)]
496pub struct AnnotateVideoResponse {
497 /// Annotation results for all videos specified in `AnnotateVideoRequest`.
498 #[prost(message, repeated, tag="1")]
499 pub annotation_results: ::std::vec::Vec<VideoAnnotationResults>,
500}
501/// Annotation progress for a single video.
502#[derive(Clone, PartialEq, ::prost::Message)]
503pub struct VideoAnnotationProgress {
504 /// Video file location in
505 /// [Google Cloud Storage](https://cloud.google.com/storage/).
506 #[prost(string, tag="1")]
507 pub input_uri: std::string::String,
508 /// Approximate percentage processed thus far. Guaranteed to be
509 /// 100 when fully processed.
510 #[prost(int32, tag="2")]
511 pub progress_percent: i32,
512 /// Time when the request was received.
513 #[prost(message, optional, tag="3")]
514 pub start_time: ::std::option::Option<::prost_types::Timestamp>,
515 /// Time of the most recent update.
516 #[prost(message, optional, tag="4")]
517 pub update_time: ::std::option::Option<::prost_types::Timestamp>,
518 /// Specifies which feature is being tracked if the request contains more than
519 /// one features.
520 #[prost(enumeration="Feature", tag="5")]
521 pub feature: i32,
522 /// Specifies which segment is being tracked if the request contains more than
523 /// one segments.
524 #[prost(message, optional, tag="6")]
525 pub segment: ::std::option::Option<VideoSegment>,
526}
527/// Video annotation progress. Included in the `metadata`
528/// field of the `Operation` returned by the `GetOperation`
529/// call of the `google::longrunning::Operations` service.
530#[derive(Clone, PartialEq, ::prost::Message)]
531pub struct AnnotateVideoProgress {
532 /// Progress metadata for all videos specified in `AnnotateVideoRequest`.
533 #[prost(message, repeated, tag="1")]
534 pub annotation_progress: ::std::vec::Vec<VideoAnnotationProgress>,
535}
536/// Config for SPEECH_TRANSCRIPTION.
537#[derive(Clone, PartialEq, ::prost::Message)]
538pub struct SpeechTranscriptionConfig {
539 /// Required. *Required* The language of the supplied audio as a
540 /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
541 /// Example: "en-US".
542 /// See [Language Support](https://cloud.google.com/speech/docs/languages)
543 /// for a list of the currently supported language codes.
544 #[prost(string, tag="1")]
545 pub language_code: std::string::String,
546 /// Optional. Maximum number of recognition hypotheses to be returned.
547 /// Specifically, the maximum number of `SpeechRecognitionAlternative` messages
548 /// within each `SpeechTranscription`. The server may return fewer than
549 /// `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will
550 /// return a maximum of one. If omitted, will return a maximum of one.
551 #[prost(int32, tag="2")]
552 pub max_alternatives: i32,
553 /// Optional. If set to `true`, the server will attempt to filter out
554 /// profanities, replacing all but the initial character in each filtered word
555 /// with asterisks, e.g. "f***". If set to `false` or omitted, profanities
556 /// won't be filtered out.
557 #[prost(bool, tag="3")]
558 pub filter_profanity: bool,
559 /// Optional. A means to provide context to assist the speech recognition.
560 #[prost(message, repeated, tag="4")]
561 pub speech_contexts: ::std::vec::Vec<SpeechContext>,
562 /// Optional. If 'true', adds punctuation to recognition result hypotheses.
563 /// This feature is only available in select languages. Setting this for
564 /// requests in other languages has no effect at all. The default 'false' value
565 /// does not add punctuation to result hypotheses. NOTE: "This is currently
566 /// offered as an experimental service, complimentary to all users. In the
567 /// future this may be exclusively available as a premium feature."
568 #[prost(bool, tag="5")]
569 pub enable_automatic_punctuation: bool,
570 /// Optional. For file formats, such as MXF or MKV, supporting multiple audio
571 /// tracks, specify up to two tracks. Default: track 0.
572 #[prost(int32, repeated, packed="false", tag="6")]
573 pub audio_tracks: ::std::vec::Vec<i32>,
574 /// Optional. If 'true', enables speaker detection for each recognized word in
575 /// the top alternative of the recognition result using a speaker_tag provided
576 /// in the WordInfo.
577 /// Note: When this is true, we send all the words from the beginning of the
578 /// audio for the top alternative in every consecutive responses.
579 /// This is done in order to improve our speaker tags as our models learn to
580 /// identify the speakers in the conversation over time.
581 #[prost(bool, tag="7")]
582 pub enable_speaker_diarization: bool,
583 /// Optional. If set, specifies the estimated number of speakers in the
584 /// conversation. If not set, defaults to '2'. Ignored unless
585 /// enable_speaker_diarization is set to true.
586 #[prost(int32, tag="8")]
587 pub diarization_speaker_count: i32,
588 /// Optional. If `true`, the top result includes a list of words and the
589 /// confidence for those words. If `false`, no word-level confidence
590 /// information is returned. The default is `false`.
591 #[prost(bool, tag="9")]
592 pub enable_word_confidence: bool,
593}
594/// Provides "hints" to the speech recognizer to favor specific words and phrases
595/// in the results.
596#[derive(Clone, PartialEq, ::prost::Message)]
597pub struct SpeechContext {
598 /// Optional. A list of strings containing words and phrases "hints" so that
599 /// the speech recognition is more likely to recognize them. This can be used
600 /// to improve the accuracy for specific words and phrases, for example, if
601 /// specific commands are typically spoken by the user. This can also be used
602 /// to add additional words to the vocabulary of the recognizer. See
603 /// [usage limits](https://cloud.google.com/speech/limits#content).
604 #[prost(string, repeated, tag="1")]
605 pub phrases: ::std::vec::Vec<std::string::String>,
606}
607/// A speech recognition result corresponding to a portion of the audio.
608#[derive(Clone, PartialEq, ::prost::Message)]
609pub struct SpeechTranscription {
610 /// May contain one or more recognition hypotheses (up to the maximum specified
611 /// in `max_alternatives`). These alternatives are ordered in terms of
612 /// accuracy, with the top (first) alternative being the most probable, as
613 /// ranked by the recognizer.
614 #[prost(message, repeated, tag="1")]
615 pub alternatives: ::std::vec::Vec<SpeechRecognitionAlternative>,
616 /// Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
617 /// language tag of the language in this result. This language code was
618 /// detected to have the most likelihood of being spoken in the audio.
619 #[prost(string, tag="2")]
620 pub language_code: std::string::String,
621}
622/// Alternative hypotheses (a.k.a. n-best list).
623#[derive(Clone, PartialEq, ::prost::Message)]
624pub struct SpeechRecognitionAlternative {
625 /// Transcript text representing the words that the user spoke.
626 #[prost(string, tag="1")]
627 pub transcript: std::string::String,
628 /// Output only. The confidence estimate between 0.0 and 1.0. A higher number
629 /// indicates an estimated greater likelihood that the recognized words are
630 /// correct. This field is set only for the top alternative.
631 /// This field is not guaranteed to be accurate and users should not rely on it
632 /// to be always provided.
633 /// The default of 0.0 is a sentinel value indicating `confidence` was not set.
634 #[prost(float, tag="2")]
635 pub confidence: f32,
636 /// Output only. A list of word-specific information for each recognized word.
637 /// Note: When `enable_speaker_diarization` is true, you will see all the words
638 /// from the beginning of the audio.
639 #[prost(message, repeated, tag="3")]
640 pub words: ::std::vec::Vec<WordInfo>,
641}
642/// Word-specific information for recognized words. Word information is only
643/// included in the response when certain request parameters are set, such
644/// as `enable_word_time_offsets`.
645#[derive(Clone, PartialEq, ::prost::Message)]
646pub struct WordInfo {
647 /// Time offset relative to the beginning of the audio, and
648 /// corresponding to the start of the spoken word. This field is only set if
649 /// `enable_word_time_offsets=true` and only in the top hypothesis. This is an
650 /// experimental feature and the accuracy of the time offset can vary.
651 #[prost(message, optional, tag="1")]
652 pub start_time: ::std::option::Option<::prost_types::Duration>,
653 /// Time offset relative to the beginning of the audio, and
654 /// corresponding to the end of the spoken word. This field is only set if
655 /// `enable_word_time_offsets=true` and only in the top hypothesis. This is an
656 /// experimental feature and the accuracy of the time offset can vary.
657 #[prost(message, optional, tag="2")]
658 pub end_time: ::std::option::Option<::prost_types::Duration>,
659 /// The word corresponding to this set of information.
660 #[prost(string, tag="3")]
661 pub word: std::string::String,
662 /// Output only. The confidence estimate between 0.0 and 1.0. A higher number
663 /// indicates an estimated greater likelihood that the recognized words are
664 /// correct. This field is set only for the top alternative.
665 /// This field is not guaranteed to be accurate and users should not rely on it
666 /// to be always provided.
667 /// The default of 0.0 is a sentinel value indicating `confidence` was not set.
668 #[prost(float, tag="4")]
669 pub confidence: f32,
670 /// Output only. A distinct integer value is assigned for every speaker within
671 /// the audio. This field specifies which one of those speakers was detected to
672 /// have spoken this word. Value ranges from 1 up to diarization_speaker_count,
673 /// and is only set if speaker diarization is enabled.
674 #[prost(int32, tag="5")]
675 pub speaker_tag: i32,
676}
677/// A vertex represents a 2D point in the image.
678/// NOTE: the normalized vertex coordinates are relative to the original image
679/// and range from 0 to 1.
680#[derive(Clone, PartialEq, ::prost::Message)]
681pub struct NormalizedVertex {
682 /// X coordinate.
683 #[prost(float, tag="1")]
684 pub x: f32,
685 /// Y coordinate.
686 #[prost(float, tag="2")]
687 pub y: f32,
688}
689/// Normalized bounding polygon for text (that might not be aligned with axis).
690/// Contains list of the corner points in clockwise order starting from
691/// top-left corner. For example, for a rectangular bounding box:
692/// When the text is horizontal it might look like:
693/// 0----1
694/// | |
695/// 3----2
696///
697/// When it's clockwise rotated 180 degrees around the top-left corner it
698/// becomes:
699/// 2----3
700/// | |
701/// 1----0
702///
703/// and the vertex order will still be (0, 1, 2, 3). Note that values can be less
704/// than 0, or greater than 1 due to trignometric calculations for location of
705/// the box.
706#[derive(Clone, PartialEq, ::prost::Message)]
707pub struct NormalizedBoundingPoly {
708 /// Normalized vertices of the bounding polygon.
709 #[prost(message, repeated, tag="1")]
710 pub vertices: ::std::vec::Vec<NormalizedVertex>,
711}
712/// Video segment level annotation results for text detection.
713#[derive(Clone, PartialEq, ::prost::Message)]
714pub struct TextSegment {
715 /// Video segment where a text snippet was detected.
716 #[prost(message, optional, tag="1")]
717 pub segment: ::std::option::Option<VideoSegment>,
718 /// Confidence for the track of detected text. It is calculated as the highest
719 /// over all frames where OCR detected text appears.
720 #[prost(float, tag="2")]
721 pub confidence: f32,
722 /// Information related to the frames where OCR detected text appears.
723 #[prost(message, repeated, tag="3")]
724 pub frames: ::std::vec::Vec<TextFrame>,
725}
726/// Video frame level annotation results for text annotation (OCR).
727/// Contains information regarding timestamp and bounding box locations for the
728/// frames containing detected OCR text snippets.
729#[derive(Clone, PartialEq, ::prost::Message)]
730pub struct TextFrame {
731 /// Bounding polygon of the detected text for this frame.
732 #[prost(message, optional, tag="1")]
733 pub rotated_bounding_box: ::std::option::Option<NormalizedBoundingPoly>,
734 /// Timestamp of this frame.
735 #[prost(message, optional, tag="2")]
736 pub time_offset: ::std::option::Option<::prost_types::Duration>,
737}
738/// Annotations related to one detected OCR text snippet. This will contain the
739/// corresponding text, confidence value, and frame level information for each
740/// detection.
741#[derive(Clone, PartialEq, ::prost::Message)]
742pub struct TextAnnotation {
743 /// The detected text.
744 #[prost(string, tag="1")]
745 pub text: std::string::String,
746 /// All video segments where OCR detected text appears.
747 #[prost(message, repeated, tag="2")]
748 pub segments: ::std::vec::Vec<TextSegment>,
749}
750/// Video frame level annotations for object detection and tracking. This field
751/// stores per frame location, time offset, and confidence.
752#[derive(Clone, PartialEq, ::prost::Message)]
753pub struct ObjectTrackingFrame {
754 /// The normalized bounding box location of this object track for the frame.
755 #[prost(message, optional, tag="1")]
756 pub normalized_bounding_box: ::std::option::Option<NormalizedBoundingBox>,
757 /// The timestamp of the frame in microseconds.
758 #[prost(message, optional, tag="2")]
759 pub time_offset: ::std::option::Option<::prost_types::Duration>,
760}
761/// Annotations corresponding to one tracked object.
762#[derive(Clone, PartialEq, ::prost::Message)]
763pub struct ObjectTrackingAnnotation {
764 /// Entity to specify the object category that this track is labeled as.
765 #[prost(message, optional, tag="1")]
766 pub entity: ::std::option::Option<Entity>,
767 /// Object category's labeling confidence of this track.
768 #[prost(float, tag="4")]
769 pub confidence: f32,
770 /// Information corresponding to all frames where this object track appears.
771 /// Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame
772 /// messages in frames.
773 /// Streaming mode: it can only be one ObjectTrackingFrame message in frames.
774 #[prost(message, repeated, tag="2")]
775 pub frames: ::std::vec::Vec<ObjectTrackingFrame>,
776 /// Different representation of tracking info in non-streaming batch
777 /// and streaming modes.
778 #[prost(oneof="object_tracking_annotation::TrackInfo", tags="3, 5")]
779 pub track_info: ::std::option::Option<object_tracking_annotation::TrackInfo>,
780}
781pub mod object_tracking_annotation {
782 /// Different representation of tracking info in non-streaming batch
783 /// and streaming modes.
784 #[derive(Clone, PartialEq, ::prost::Oneof)]
785 pub enum TrackInfo {
786 /// Non-streaming batch mode ONLY.
787 /// Each object track corresponds to one video segment where it appears.
788 #[prost(message, tag="3")]
789 Segment(super::VideoSegment),
790 /// Streaming mode ONLY.
791 /// In streaming mode, we do not know the end time of a tracked object
792 /// before it is completed. Hence, there is no VideoSegment info returned.
793 /// Instead, we provide a unique identifiable integer track_id so that
794 /// the customers can correlate the results of the ongoing
795 /// ObjectTrackAnnotation of the same track_id over time.
796 #[prost(int64, tag="5")]
797 TrackId(i64),
798 }
799}
800/// Annotation corresponding to one detected, tracked and recognized logo class.
801#[derive(Clone, PartialEq, ::prost::Message)]
802pub struct LogoRecognitionAnnotation {
803 /// Entity category information to specify the logo class that all the logo
804 /// tracks within this LogoRecognitionAnnotation are recognized as.
805 #[prost(message, optional, tag="1")]
806 pub entity: ::std::option::Option<Entity>,
807 /// All logo tracks where the recognized logo appears. Each track corresponds
808 /// to one logo instance appearing in consecutive frames.
809 #[prost(message, repeated, tag="2")]
810 pub tracks: ::std::vec::Vec<Track>,
811 /// All video segments where the recognized logo appears. There might be
812 /// multiple instances of the same logo class appearing in one VideoSegment.
813 #[prost(message, repeated, tag="3")]
814 pub segments: ::std::vec::Vec<VideoSegment>,
815}
816/// The top-level message sent by the client for the `StreamingAnnotateVideo`
817/// method. Multiple `StreamingAnnotateVideoRequest` messages are sent.
818/// The first message must only contain a `StreamingVideoConfig` message.
819/// All subsequent messages must only contain `input_content` data.
820#[derive(Clone, PartialEq, ::prost::Message)]
821pub struct StreamingAnnotateVideoRequest {
822 /// *Required* The streaming request, which is either a streaming config or
823 /// video content.
824 #[prost(oneof="streaming_annotate_video_request::StreamingRequest", tags="1, 2")]
825 pub streaming_request: ::std::option::Option<streaming_annotate_video_request::StreamingRequest>,
826}
827pub mod streaming_annotate_video_request {
828 /// *Required* The streaming request, which is either a streaming config or
829 /// video content.
830 #[derive(Clone, PartialEq, ::prost::Oneof)]
831 pub enum StreamingRequest {
832 /// Provides information to the annotator, specifing how to process the
833 /// request. The first `AnnotateStreamingVideoRequest` message must only
834 /// contain a `video_config` message.
835 #[prost(message, tag="1")]
836 VideoConfig(super::StreamingVideoConfig),
837 /// The video data to be annotated. Chunks of video data are sequentially
838 /// sent in `StreamingAnnotateVideoRequest` messages. Except the initial
839 /// `StreamingAnnotateVideoRequest` message containing only
840 /// `video_config`, all subsequent `AnnotateStreamingVideoRequest`
841 /// messages must only contain `input_content` field.
842 /// Note: as with all bytes fields, protobuffers use a pure binary
843 /// representation (not base64).
844 #[prost(bytes, tag="2")]
845 InputContent(std::vec::Vec<u8>),
846 }
847}
848/// `StreamingAnnotateVideoResponse` is the only message returned to the client
849/// by `StreamingAnnotateVideo`. A series of zero or more
850/// `StreamingAnnotateVideoResponse` messages are streamed back to the client.
851#[derive(Clone, PartialEq, ::prost::Message)]
852pub struct StreamingAnnotateVideoResponse {
853 /// If set, returns a [google.rpc.Status][google.rpc.Status] message that
854 /// specifies the error for the operation.
855 #[prost(message, optional, tag="1")]
856 pub error: ::std::option::Option<super::super::super::rpc::Status>,
857 /// Streaming annotation results.
858 #[prost(message, optional, tag="2")]
859 pub annotation_results: ::std::option::Option<StreamingVideoAnnotationResults>,
860 /// GCS URI that stores annotation results of one streaming session.
861 /// It is a directory that can hold multiple files in JSON format.
862 /// Example uri format:
863 /// gs://bucket_id/object_id/cloud_project_name-session_id
864 #[prost(string, tag="3")]
865 pub annotation_results_uri: std::string::String,
866}
867/// Config for STREAMING_AUTOML_CLASSIFICATION.
868#[derive(Clone, PartialEq, ::prost::Message)]
869pub struct StreamingAutomlClassificationConfig {
870 /// Resource name of AutoML model.
871 /// Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
872 #[prost(string, tag="1")]
873 pub model_name: std::string::String,
874}
875/// Config for STREAMING_AUTOML_OBJECT_TRACKING.
876#[derive(Clone, PartialEq, ::prost::Message)]
877pub struct StreamingAutomlObjectTrackingConfig {
878 /// Resource name of AutoML model.
879 /// Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
880 #[prost(string, tag="1")]
881 pub model_name: std::string::String,
882}
883/// Config for STREAMING_EXPLICIT_CONTENT_DETECTION.
884#[derive(Clone, PartialEq, ::prost::Message)]
885pub struct StreamingExplicitContentDetectionConfig {
886}
887/// Config for STREAMING_LABEL_DETECTION.
888#[derive(Clone, PartialEq, ::prost::Message)]
889pub struct StreamingLabelDetectionConfig {
890 /// Whether the video has been captured from a stationary (i.e. non-moving)
891 /// camera. When set to true, might improve detection accuracy for moving
892 /// objects. Default: false.
893 #[prost(bool, tag="1")]
894 pub stationary_camera: bool,
895}
896/// Config for STREAMING_OBJECT_TRACKING.
897#[derive(Clone, PartialEq, ::prost::Message)]
898pub struct StreamingObjectTrackingConfig {
899}
900/// Config for STREAMING_SHOT_CHANGE_DETECTION.
901#[derive(Clone, PartialEq, ::prost::Message)]
902pub struct StreamingShotChangeDetectionConfig {
903}
904/// Config for streaming storage option.
905#[derive(Clone, PartialEq, ::prost::Message)]
906pub struct StreamingStorageConfig {
907 /// Enable streaming storage. Default: false.
908 #[prost(bool, tag="1")]
909 pub enable_storage_annotation_result: bool,
910 /// GCS URI to store all annotation results for one client. Client should
911 /// specify this field as the top-level storage directory. Annotation results
912 /// of different sessions will be put into different sub-directories denoted
913 /// by project_name and session_id. All sub-directories will be auto generated
914 /// by program and will be made accessible to client in response proto.
915 /// URIs must be specified in the following format: `gs://bucket-id/object-id`
916 /// `bucket-id` should be a valid GCS bucket created by client and bucket
917 /// permission shall also be configured properly. `object-id` can be arbitrary
918 /// string that make sense to client. Other URI formats will return error and
919 /// cause GCS write failure.
920 #[prost(string, tag="3")]
921 pub annotation_result_storage_directory: std::string::String,
922}
923/// Streaming annotation results corresponding to a portion of the video
924/// that is currently being processed.
925#[derive(Clone, PartialEq, ::prost::Message)]
926pub struct StreamingVideoAnnotationResults {
927 /// Shot annotation results. Each shot is represented as a video segment.
928 #[prost(message, repeated, tag="1")]
929 pub shot_annotations: ::std::vec::Vec<VideoSegment>,
930 /// Label annotation results.
931 #[prost(message, repeated, tag="2")]
932 pub label_annotations: ::std::vec::Vec<LabelAnnotation>,
933 /// Explicit content annotation results.
934 #[prost(message, optional, tag="3")]
935 pub explicit_annotation: ::std::option::Option<ExplicitContentAnnotation>,
936 /// Object tracking results.
937 #[prost(message, repeated, tag="4")]
938 pub object_annotations: ::std::vec::Vec<ObjectTrackingAnnotation>,
939}
940/// Provides information to the annotator that specifies how to process the
941/// request.
942#[derive(Clone, PartialEq, ::prost::Message)]
943pub struct StreamingVideoConfig {
944 /// Requested annotation feature.
945 #[prost(enumeration="StreamingFeature", tag="1")]
946 pub feature: i32,
947 /// Streaming storage option. By default: storage is disabled.
948 #[prost(message, optional, tag="30")]
949 pub storage_config: ::std::option::Option<StreamingStorageConfig>,
950 /// Config for requested annotation feature.
951 #[prost(oneof="streaming_video_config::StreamingConfig", tags="2, 3, 4, 5, 21, 22")]
952 pub streaming_config: ::std::option::Option<streaming_video_config::StreamingConfig>,
953}
954pub mod streaming_video_config {
955 /// Config for requested annotation feature.
956 #[derive(Clone, PartialEq, ::prost::Oneof)]
957 pub enum StreamingConfig {
958 /// Config for STREAMING_SHOT_CHANGE_DETECTION.
959 #[prost(message, tag="2")]
960 ShotChangeDetectionConfig(super::StreamingShotChangeDetectionConfig),
961 /// Config for STREAMING_LABEL_DETECTION.
962 #[prost(message, tag="3")]
963 LabelDetectionConfig(super::StreamingLabelDetectionConfig),
964 /// Config for STREAMING_EXPLICIT_CONTENT_DETECTION.
965 #[prost(message, tag="4")]
966 ExplicitContentDetectionConfig(super::StreamingExplicitContentDetectionConfig),
967 /// Config for STREAMING_OBJECT_TRACKING.
968 #[prost(message, tag="5")]
969 ObjectTrackingConfig(super::StreamingObjectTrackingConfig),
970 /// Config for STREAMING_AUTOML_CLASSIFICATION.
971 #[prost(message, tag="21")]
972 AutomlClassificationConfig(super::StreamingAutomlClassificationConfig),
973 /// Config for STREAMING_AUTOML_OBJECT_TRACKING.
974 #[prost(message, tag="22")]
975 AutomlObjectTrackingConfig(super::StreamingAutomlObjectTrackingConfig),
976 }
977}
978/// Video annotation feature.
979#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
980#[repr(i32)]
981pub enum Feature {
982 /// Unspecified.
983 Unspecified = 0,
984 /// Label detection. Detect objects, such as dog or flower.
985 LabelDetection = 1,
986 /// Shot change detection.
987 ShotChangeDetection = 2,
988 /// Explicit content detection.
989 ExplicitContentDetection = 3,
990 /// Human face detection.
991 FaceDetection = 4,
992 /// Speech transcription.
993 SpeechTranscription = 6,
994 /// OCR text detection and tracking.
995 TextDetection = 7,
996 /// Object detection and tracking.
997 ObjectTracking = 9,
998 /// Logo detection, tracking, and recognition.
999 LogoRecognition = 12,
1000 /// Celebrity recognition.
1001 CelebrityRecognition = 13,
1002 /// Person detection.
1003 PersonDetection = 14,
1004}
1005/// Label detection mode.
1006#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1007#[repr(i32)]
1008pub enum LabelDetectionMode {
1009 /// Unspecified.
1010 Unspecified = 0,
1011 /// Detect shot-level labels.
1012 ShotMode = 1,
1013 /// Detect frame-level labels.
1014 FrameMode = 2,
1015 /// Detect both shot-level and frame-level labels.
1016 ShotAndFrameMode = 3,
1017}
1018/// Bucketized representation of likelihood.
1019#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1020#[repr(i32)]
1021pub enum Likelihood {
1022 /// Unspecified likelihood.
1023 Unspecified = 0,
1024 /// Very unlikely.
1025 VeryUnlikely = 1,
1026 /// Unlikely.
1027 Unlikely = 2,
1028 /// Possible.
1029 Possible = 3,
1030 /// Likely.
1031 Likely = 4,
1032 /// Very likely.
1033 VeryLikely = 5,
1034}
1035/// Streaming video annotation feature.
1036#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1037#[repr(i32)]
1038pub enum StreamingFeature {
1039 /// Unspecified.
1040 Unspecified = 0,
1041 /// Label detection. Detect objects, such as dog or flower.
1042 StreamingLabelDetection = 1,
1043 /// Shot change detection.
1044 StreamingShotChangeDetection = 2,
1045 /// Explicit content detection.
1046 StreamingExplicitContentDetection = 3,
1047 /// Object detection and tracking.
1048 StreamingObjectTracking = 4,
1049 /// Video classification based on AutoML model.
1050 StreamingAutomlClassification = 21,
1051 /// Object detection and tracking based on AutoML model.
1052 StreamingAutomlObjectTracking = 22,
1053}
1054# [ doc = r" Generated client implementations." ] pub mod video_intelligence_service_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; # [ doc = " Service that implements Google Cloud Video Intelligence API." ] pub struct VideoIntelligenceServiceClient < T > { inner : tonic :: client :: Grpc < T > , } impl < T > VideoIntelligenceServiceClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Performs asynchronous video annotation. Progress and results can be" ] # [ doc = " retrieved through the `google.longrunning.Operations` interface." ] # [ doc = " `Operation.metadata` contains `AnnotateVideoProgress` (progress)." ] # [ doc = " `Operation.response` contains `AnnotateVideoResponse` (results)." ] pub async fn annotate_video ( & mut self , request : impl tonic :: IntoRequest < super :: AnnotateVideoRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: longrunning :: Operation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService/AnnotateVideo" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for VideoIntelligenceServiceClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for VideoIntelligenceServiceClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "VideoIntelligenceServiceClient {{ ... }}" ) } } } # [ doc = r" Generated client implementations." ] pub mod streaming_video_intelligence_service_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; # [ doc = " Service that implements streaming Google Cloud Video Intelligence API." ] pub struct StreamingVideoIntelligenceServiceClient < T > { inner : tonic :: client :: Grpc < T > , } impl < T > StreamingVideoIntelligenceServiceClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Performs video annotation with bidirectional streaming: emitting results" ] # [ doc = " while sending video/audio bytes." ] # [ doc = " This method is only available via the gRPC API (not REST)." ] pub async fn streaming_annotate_video ( & mut self , request : impl tonic :: IntoStreamingRequest < Message = super :: StreamingAnnotateVideoRequest > ) -> Result < tonic :: Response < tonic :: codec :: Streaming < super :: StreamingAnnotateVideoResponse >> , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService/StreamingAnnotateVideo" ) ; self . inner . streaming ( request . into_streaming_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for StreamingVideoIntelligenceServiceClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for StreamingVideoIntelligenceServiceClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "StreamingVideoIntelligenceServiceClient {{ ... }}" ) } } }use serde :: { Serialize , Deserialize } ;