/// Video annotation request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnotateVideoRequest {
/// Input video location. Currently, only
/// [Cloud Storage]() URIs are
/// supported. URIs must be specified in the following format:
/// `gs://bucket-id/object-id` (other URI formats return
/// \[google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT\]). For
/// more information, see [Request
/// URIs](). To identify
/// multiple videos, a video URI may include wildcards in the `object-id`.
/// Supported wildcards: '*' to match 0 or more characters;
/// '?' to match 1 character. If unset, the input video should be embedded
/// in the request as `input_content`. If set, `input_content` must be unset.
#[prost(string, tag = "1")]
pub input_uri: ::prost::alloc::string::String,
/// The video data bytes.
/// If unset, the input video(s) should be specified via the `input_uri`.
/// If set, `input_uri` must be unset.
#[prost(bytes = "vec", tag = "6")]
pub input_content: ::prost::alloc::vec::Vec,
/// Required. Requested video annotation features.
#[prost(enumeration = "Feature", repeated, packed = "false", tag = "2")]
pub features: ::prost::alloc::vec::Vec,
/// Additional video context and/or feature-specific parameters.
#[prost(message, optional, tag = "3")]
pub video_context: ::core::option::Option,
/// Optional. Location where the output (in JSON format) should be stored.
/// Currently, only [Cloud Storage]()
/// URIs are supported. These must be specified in the following format:
/// `gs://bucket-id/object-id` (other URI formats return
/// \[google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT\]). For
/// more information, see [Request
/// URIs]().
#[prost(string, tag = "4")]
pub output_uri: ::prost::alloc::string::String,
/// Optional. Cloud region where annotation should take place. Supported cloud
/// regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no
/// region is specified, the region will be determined based on video file
/// location.
#[prost(string, tag = "5")]
pub location_id: ::prost::alloc::string::String,
}
/// Video context and/or feature-specific parameters.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoContext {
/// Video segments to annotate. The segments may overlap and are not required
/// to be contiguous or span the whole video. If unspecified, each video is
/// treated as a single segment.
#[prost(message, repeated, tag = "1")]
pub segments: ::prost::alloc::vec::Vec,
/// Config for LABEL_DETECTION.
#[prost(message, optional, tag = "2")]
pub label_detection_config: ::core::option::Option,
/// Config for SHOT_CHANGE_DETECTION.
#[prost(message, optional, tag = "3")]
pub shot_change_detection_config: ::core::option::Option,
/// Config for EXPLICIT_CONTENT_DETECTION.
#[prost(message, optional, tag = "4")]
pub explicit_content_detection_config: ::core::option::Option,
/// Config for FACE_DETECTION.
#[prost(message, optional, tag = "5")]
pub face_detection_config: ::core::option::Option,
/// Config for SPEECH_TRANSCRIPTION.
#[prost(message, optional, tag = "6")]
pub speech_transcription_config: ::core::option::Option,
/// Config for TEXT_DETECTION.
#[prost(message, optional, tag = "8")]
pub text_detection_config: ::core::option::Option,
/// Config for PERSON_DETECTION.
#[prost(message, optional, tag = "11")]
pub person_detection_config: ::core::option::Option,
/// Config for OBJECT_TRACKING.
#[prost(message, optional, tag = "13")]
pub object_tracking_config: ::core::option::Option,
}
/// Config for LABEL_DETECTION.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LabelDetectionConfig {
/// What labels should be detected with LABEL_DETECTION, in addition to
/// video-level labels or segment-level labels.
/// If unspecified, defaults to `SHOT_MODE`.
#[prost(enumeration = "LabelDetectionMode", tag = "1")]
pub label_detection_mode: i32,
/// Whether the video has been shot from a stationary (i.e., non-moving)
/// camera. When set to true, might improve detection accuracy for moving
/// objects. Should be used with `SHOT_AND_FRAME_MODE` enabled.
#[prost(bool, tag = "2")]
pub stationary_camera: bool,
/// Model to use for label detection.
/// Supported values: "builtin/stable" (the default if unset) and
/// "builtin/latest".
#[prost(string, tag = "3")]
pub model: ::prost::alloc::string::String,
/// The confidence threshold we perform filtering on the labels from
/// frame-level detection. If not set, it is set to 0.4 by default. The valid
/// range for this threshold is [0.1, 0.9]. Any value set outside of this
/// range will be clipped.
/// Note: For best results, follow the default threshold. We will update
/// the default threshold everytime when we release a new model.
#[prost(float, tag = "4")]
pub frame_confidence_threshold: f32,
/// The confidence threshold we perform filtering on the labels from
/// video-level and shot-level detections. If not set, it's set to 0.3 by
/// default. The valid range for this threshold is [0.1, 0.9]. Any value set
/// outside of this range will be clipped.
/// Note: For best results, follow the default threshold. We will update
/// the default threshold everytime when we release a new model.
#[prost(float, tag = "5")]
pub video_confidence_threshold: f32,
}
/// Config for SHOT_CHANGE_DETECTION.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShotChangeDetectionConfig {
/// Model to use for shot change detection.
/// Supported values: "builtin/stable" (the default if unset) and
/// "builtin/latest".
#[prost(string, tag = "1")]
pub model: ::prost::alloc::string::String,
}
/// Config for OBJECT_TRACKING.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectTrackingConfig {
/// Model to use for object tracking.
/// Supported values: "builtin/stable" (the default if unset) and
/// "builtin/latest".
#[prost(string, tag = "1")]
pub model: ::prost::alloc::string::String,
}
/// Config for EXPLICIT_CONTENT_DETECTION.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExplicitContentDetectionConfig {
/// Model to use for explicit content detection.
/// Supported values: "builtin/stable" (the default if unset) and
/// "builtin/latest".
#[prost(string, tag = "1")]
pub model: ::prost::alloc::string::String,
}
/// Config for FACE_DETECTION.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FaceDetectionConfig {
/// Model to use for face detection.
/// Supported values: "builtin/stable" (the default if unset) and
/// "builtin/latest".
#[prost(string, tag = "1")]
pub model: ::prost::alloc::string::String,
/// Whether bounding boxes are included in the face annotation output.
#[prost(bool, tag = "2")]
pub include_bounding_boxes: bool,
/// Whether to enable face attributes detection, such as glasses, dark_glasses,
/// mouth_open etc. Ignored if 'include_bounding_boxes' is set to false.
#[prost(bool, tag = "5")]
pub include_attributes: bool,
}
/// Config for PERSON_DETECTION.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PersonDetectionConfig {
/// Whether bounding boxes are included in the person detection annotation
/// output.
#[prost(bool, tag = "1")]
pub include_bounding_boxes: bool,
/// Whether to enable pose landmarks detection. Ignored if
/// 'include_bounding_boxes' is set to false.
#[prost(bool, tag = "2")]
pub include_pose_landmarks: bool,
/// Whether to enable person attributes detection, such as cloth color (black,
/// blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair,
/// etc.
/// Ignored if 'include_bounding_boxes' is set to false.
#[prost(bool, tag = "3")]
pub include_attributes: bool,
}
/// Config for TEXT_DETECTION.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextDetectionConfig {
/// Language hint can be specified if the language to be detected is known a
/// priori. It can increase the accuracy of the detection. Language hint must
/// be language code in BCP-47 format.
///
/// Automatic language detection is performed if no hint is provided.
#[prost(string, repeated, tag = "1")]
pub language_hints: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Model to use for text detection.
/// Supported values: "builtin/stable" (the default if unset) and
/// "builtin/latest".
#[prost(string, tag = "2")]
pub model: ::prost::alloc::string::String,
}
/// Video segment.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoSegment {
/// Time-offset, relative to the beginning of the video,
/// corresponding to the start of the segment (inclusive).
#[prost(message, optional, tag = "1")]
pub start_time_offset: ::core::option::Option<::prost_types::Duration>,
/// Time-offset, relative to the beginning of the video,
/// corresponding to the end of the segment (inclusive).
#[prost(message, optional, tag = "2")]
pub end_time_offset: ::core::option::Option<::prost_types::Duration>,
}
/// Video segment level annotation results for label detection.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LabelSegment {
/// Video segment where a label was detected.
#[prost(message, optional, tag = "1")]
pub segment: ::core::option::Option,
/// Confidence that the label is accurate. Range: [0, 1].
#[prost(float, tag = "2")]
pub confidence: f32,
}
/// Video frame level annotation results for label detection.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LabelFrame {
/// Time-offset, relative to the beginning of the video, corresponding to the
/// video frame for this location.
#[prost(message, optional, tag = "1")]
pub time_offset: ::core::option::Option<::prost_types::Duration>,
/// Confidence that the label is accurate. Range: [0, 1].
#[prost(float, tag = "2")]
pub confidence: f32,
}
/// Detected entity from video analysis.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entity {
/// Opaque entity ID. Some IDs may be available in
/// [Google Knowledge Graph Search
/// API]().
#[prost(string, tag = "1")]
pub entity_id: ::prost::alloc::string::String,
/// Textual description, e.g., `Fixed-gear bicycle`.
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Language code for `description` in BCP-47 format.
#[prost(string, tag = "3")]
pub language_code: ::prost::alloc::string::String,
}
/// Label annotation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LabelAnnotation {
/// Detected entity.
#[prost(message, optional, tag = "1")]
pub entity: ::core::option::Option,
/// Common categories for the detected entity.
/// For example, when the label is `Terrier`, the category is likely `dog`. And
/// in some cases there might be more than one categories e.g., `Terrier` could
/// also be a `pet`.
#[prost(message, repeated, tag = "2")]
pub category_entities: ::prost::alloc::vec::Vec,
/// All video segments where a label was detected.
#[prost(message, repeated, tag = "3")]
pub segments: ::prost::alloc::vec::Vec,
/// All video frames where a label was detected.
#[prost(message, repeated, tag = "4")]
pub frames: ::prost::alloc::vec::Vec,
}
/// Video frame level annotation results for explicit content.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExplicitContentFrame {
/// Time-offset, relative to the beginning of the video, corresponding to the
/// video frame for this location.
#[prost(message, optional, tag = "1")]
pub time_offset: ::core::option::Option<::prost_types::Duration>,
/// Likelihood of the pornography content..
#[prost(enumeration = "Likelihood", tag = "2")]
pub pornography_likelihood: i32,
}
/// Explicit content annotation (based on per-frame visual signals only).
/// If no explicit content has been detected in a frame, no annotations are
/// present for that frame.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExplicitContentAnnotation {
/// All video frames where explicit content was detected.
#[prost(message, repeated, tag = "1")]
pub frames: ::prost::alloc::vec::Vec,
}
/// Normalized bounding box.
/// The normalized vertex coordinates are relative to the original image.
/// Range: [0, 1].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NormalizedBoundingBox {
/// Left X coordinate.
#[prost(float, tag = "1")]
pub left: f32,
/// Top Y coordinate.
#[prost(float, tag = "2")]
pub top: f32,
/// Right X coordinate.
#[prost(float, tag = "3")]
pub right: f32,
/// Bottom Y coordinate.
#[prost(float, tag = "4")]
pub bottom: f32,
}
/// For tracking related features.
/// An object at time_offset with attributes, and located with
/// normalized_bounding_box.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TimestampedObject {
/// Normalized Bounding box in a frame, where the object is located.
#[prost(message, optional, tag = "1")]
pub normalized_bounding_box: ::core::option::Option,
/// Time-offset, relative to the beginning of the video,
/// corresponding to the video frame for this object.
#[prost(message, optional, tag = "2")]
pub time_offset: ::core::option::Option<::prost_types::Duration>,
/// Optional. The attributes of the object in the bounding box.
#[prost(message, repeated, tag = "3")]
pub attributes: ::prost::alloc::vec::Vec,
/// Optional. The detected landmarks.
#[prost(message, repeated, tag = "4")]
pub landmarks: ::prost::alloc::vec::Vec,
}
/// A track of an object instance.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Track {
/// Video segment of a track.
#[prost(message, optional, tag = "1")]
pub segment: ::core::option::Option,
/// The object with timestamp and attributes per frame in the track.
#[prost(message, repeated, tag = "2")]
pub timestamped_objects: ::prost::alloc::vec::Vec,
/// Optional. Attributes in the track level.
#[prost(message, repeated, tag = "3")]
pub attributes: ::prost::alloc::vec::Vec,
/// Optional. The confidence score of the tracked object.
#[prost(float, tag = "4")]
pub confidence: f32,
}
/// A generic detected attribute represented by name in string format.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectedAttribute {
/// The name of the attribute, for example, glasses, dark_glasses, mouth_open.
/// A full list of supported type names will be provided in the document.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Detected attribute confidence. Range [0, 1].
#[prost(float, tag = "2")]
pub confidence: f32,
/// Text value of the detection result. For example, the value for "HairColor"
/// can be "black", "blonde", etc.
#[prost(string, tag = "3")]
pub value: ::prost::alloc::string::String,
}
/// Celebrity definition.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Celebrity {
/// The resource name of the celebrity. Have the format
/// `video-intelligence/kg-mid` indicates a celebrity from preloaded gallery.
/// kg-mid is the id in Google knowledge graph, which is unique for the
/// celebrity.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The celebrity name.
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
/// Textual description of additional information about the celebrity, if
/// applicable.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
}
/// The annotation result of a celebrity face track. RecognizedCelebrity field
/// could be empty if the face track does not have any matched celebrities.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CelebrityTrack {
/// Top N match of the celebrities for the face in this track.
#[prost(message, repeated, tag = "1")]
pub celebrities: ::prost::alloc::vec::Vec,
/// A track of a person's face.
#[prost(message, optional, tag = "3")]
pub face_track: ::core::option::Option