1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="videointelligence_v1beta2.html">Cloud Video Intelligence API</a> . <a href="videointelligence_v1beta2.videos.html">videos</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#annotate">annotate(body, x__xgafv=None)</a></code></p> 79<p class="firstline">Performs asynchronous video annotation. Progress and results can be</p> 80<h3>Method Details</h3> 81<div class="method"> 82 <code class="details" id="annotate">annotate(body, x__xgafv=None)</code> 83 <pre>Performs asynchronous video annotation. Progress and results can be 84retrieved through the `google.longrunning.Operations` interface. 85`Operation.metadata` contains `AnnotateVideoProgress` (progress). 86`Operation.response` contains `AnnotateVideoResponse` (results). 87 88Args: 89 body: object, The request body. (required) 90 The object takes the form of: 91 92{ # Video annotation request. 93 "videoContext": { # Video context and/or feature-specific parameters. # Additional video context and/or feature-specific parameters. 94 "shotChangeDetectionConfig": { # Config for SHOT_CHANGE_DETECTION. # Config for SHOT_CHANGE_DETECTION. 95 "model": "A String", # Model to use for shot change detection. 96 # Supported values: "builtin/stable" (the default if unset) and 97 # "builtin/latest". 98 }, 99 "textDetectionConfig": { # Config for TEXT_DETECTION. # Config for TEXT_DETECTION. 100 "languageHints": [ # Language hint can be specified if the language to be detected is known a 101 # priori. It can increase the accuracy of the detection. Language hint must 102 # be language code in BCP-47 format. 103 # 104 # Automatic language detection is performed if no hint is provided. 105 "A String", 106 ], 107 "model": "A String", # Model to use for text detection. 108 # Supported values: "builtin/stable" (the default if unset) and 109 # "builtin/latest". 110 }, 111 "speechTranscriptionConfig": { # Config for SPEECH_TRANSCRIPTION. # Config for SPEECH_TRANSCRIPTION. 112 "languageCode": "A String", # *Required* The language of the supplied audio as a 113 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. 114 # Example: "en-US". 115 # See [Language Support](https://cloud.google.com/speech/docs/languages) 116 # for a list of the currently supported language codes. 117 "filterProfanity": True or False, # *Optional* If set to `true`, the server will attempt to filter out 118 # profanities, replacing all but the initial character in each filtered word 119 # with asterisks, e.g. "f***". If set to `false` or omitted, profanities 120 # won't be filtered out. 121 "enableAutomaticPunctuation": True or False, # *Optional* If 'true', adds punctuation to recognition result hypotheses. 122 # This feature is only available in select languages. Setting this for 123 # requests in other languages has no effect at all. The default 'false' value 124 # does not add punctuation to result hypotheses. NOTE: "This is currently 125 # offered as an experimental service, complimentary to all users. In the 126 # future this may be exclusively available as a premium feature." 127 "enableSpeakerDiarization": True or False, # *Optional* If 'true', enables speaker detection for each recognized word in 128 # the top alternative of the recognition result using a speaker_tag provided 129 # in the WordInfo. 130 # Note: When this is true, we send all the words from the beginning of the 131 # audio for the top alternative in every consecutive responses. 132 # This is done in order to improve our speaker tags as our models learn to 133 # identify the speakers in the conversation over time. 134 "maxAlternatives": 42, # *Optional* Maximum number of recognition hypotheses to be returned. 135 # Specifically, the maximum number of `SpeechRecognitionAlternative` messages 136 # within each `SpeechTranscription`. The server may return fewer than 137 # `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will 138 # return a maximum of one. If omitted, will return a maximum of one. 139 "audioTracks": [ # *Optional* For file formats, such as MXF or MKV, supporting multiple audio 140 # tracks, specify up to two tracks. Default: track 0. 141 42, 142 ], 143 "diarizationSpeakerCount": 42, # *Optional* 144 # If set, specifies the estimated number of speakers in the conversation. 145 # If not set, defaults to '2'. 146 # Ignored unless enable_speaker_diarization is set to true. 147 "enableWordConfidence": True or False, # *Optional* If `true`, the top result includes a list of words and the 148 # confidence for those words. If `false`, no word-level confidence 149 # information is returned. The default is `false`. 150 "speechContexts": [ # *Optional* A means to provide context to assist the speech recognition. 151 { # Provides "hints" to the speech recognizer to favor specific words and phrases 152 # in the results. 153 "phrases": [ # *Optional* A list of strings containing words and phrases "hints" so that 154 # the speech recognition is more likely to recognize them. This can be used 155 # to improve the accuracy for specific words and phrases, for example, if 156 # specific commands are typically spoken by the user. This can also be used 157 # to add additional words to the vocabulary of the recognizer. See 158 # [usage limits](https://cloud.google.com/speech/limits#content). 159 "A String", 160 ], 161 }, 162 ], 163 }, 164 "segments": [ # Video segments to annotate. The segments may overlap and are not required 165 # to be contiguous or span the whole video. If unspecified, each video is 166 # treated as a single segment. 167 { # Video segment. 168 "endTimeOffset": "A String", # Time-offset, relative to the beginning of the video, 169 # corresponding to the end of the segment (inclusive). 170 "startTimeOffset": "A String", # Time-offset, relative to the beginning of the video, 171 # corresponding to the start of the segment (inclusive). 172 }, 173 ], 174 "labelDetectionConfig": { # Config for LABEL_DETECTION. # Config for LABEL_DETECTION. 175 "labelDetectionMode": "A String", # What labels should be detected with LABEL_DETECTION, in addition to 176 # video-level labels or segment-level labels. 177 # If unspecified, defaults to `SHOT_MODE`. 178 "model": "A String", # Model to use for label detection. 179 # Supported values: "builtin/stable" (the default if unset) and 180 # "builtin/latest". 181 "stationaryCamera": True or False, # Whether the video has been shot from a stationary (i.e. non-moving) camera. 182 # When set to true, might improve detection accuracy for moving objects. 183 # Should be used with `SHOT_AND_FRAME_MODE` enabled. 184 "frameConfidenceThreshold": 3.14, # The confidence threshold we perform filtering on the labels from 185 # frame-level detection. If not set, it is set to 0.4 by default. The valid 186 # range for this threshold is [0.1, 0.9]. Any value set outside of this 187 # range will be clipped. 188 # Note: for best results please follow the default threshold. We will update 189 # the default threshold everytime when we release a new model. 190 "videoConfidenceThreshold": 3.14, # The confidence threshold we perform filtering on the labels from 191 # video-level and shot-level detections. If not set, it is set to 0.3 by 192 # default. The valid range for this threshold is [0.1, 0.9]. Any value set 193 # outside of this range will be clipped. 194 # Note: for best results please follow the default threshold. We will update 195 # the default threshold everytime when we release a new model. 196 }, 197 "explicitContentDetectionConfig": { # Config for EXPLICIT_CONTENT_DETECTION. # Config for EXPLICIT_CONTENT_DETECTION. 198 "model": "A String", # Model to use for explicit content detection. 199 # Supported values: "builtin/stable" (the default if unset) and 200 # "builtin/latest". 201 }, 202 "objectTrackingConfig": { # Config for OBJECT_TRACKING. # Config for OBJECT_TRACKING. 203 "model": "A String", # Model to use for object tracking. 204 # Supported values: "builtin/stable" (the default if unset) and 205 # "builtin/latest". 206 }, 207 }, 208 "features": [ # Requested video annotation features. 209 "A String", 210 ], 211 "inputContent": "A String", # The video data bytes. 212 # If unset, the input video(s) should be specified via `input_uri`. 213 # If set, `input_uri` should be unset. 214 "inputUri": "A String", # Input video location. Currently, only 215 # [Google Cloud Storage](https://cloud.google.com/storage/) URIs are 216 # supported, which must be specified in the following format: 217 # `gs://bucket-id/object-id` (other URI formats return 218 # google.rpc.Code.INVALID_ARGUMENT). For more information, see 219 # [Request URIs](/storage/docs/reference-uris). 220 # A video URI may include wildcards in `object-id`, and thus identify 221 # multiple videos. Supported wildcards: '*' to match 0 or more characters; 222 # '?' to match 1 character. If unset, the input video should be embedded 223 # in the request as `input_content`. If set, `input_content` should be unset. 224 "locationId": "A String", # Optional cloud region where annotation should take place. Supported cloud 225 # regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region 226 # is specified, a region will be determined based on video file location. 227 "outputUri": "A String", # Optional location where the output (in JSON format) should be stored. 228 # Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) 229 # URIs are supported, which must be specified in the following format: 230 # `gs://bucket-id/object-id` (other URI formats return 231 # google.rpc.Code.INVALID_ARGUMENT). For more information, see 232 # [Request URIs](/storage/docs/reference-uris). 233 } 234 235 x__xgafv: string, V1 error format. 236 Allowed values 237 1 - v1 error format 238 2 - v2 error format 239 240Returns: 241 An object of the form: 242 243 { # This resource represents a long-running operation that is the result of a 244 # network API call. 245 "metadata": { # Service-specific metadata associated with the operation. It typically 246 # contains progress information and common metadata such as create time. 247 # Some services might not provide such metadata. Any method that returns a 248 # long-running operation should document the metadata type, if any. 249 "a_key": "", # Properties of the object. Contains field @type with type URL. 250 }, 251 "done": True or False, # If the value is `false`, it means the operation is still in progress. 252 # If `true`, the operation is completed, and either `error` or `response` is 253 # available. 254 "response": { # The normal response of the operation in case of success. If the original 255 # method returns no data on success, such as `Delete`, the response is 256 # `google.protobuf.Empty`. If the original method is standard 257 # `Get`/`Create`/`Update`, the response should be the resource. For other 258 # methods, the response should have the type `XxxResponse`, where `Xxx` 259 # is the original method name. For example, if the original method name 260 # is `TakeSnapshot()`, the inferred response type is 261 # `TakeSnapshotResponse`. 262 "a_key": "", # Properties of the object. Contains field @type with type URL. 263 }, 264 "name": "A String", # The server-assigned name, which is only unique within the same service that 265 # originally returns it. If you use the default HTTP mapping, the 266 # `name` should be a resource name ending with `operations/{unique_id}`. 267 "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation. 268 # different programming environments, including REST APIs and RPC APIs. It is 269 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 270 # three pieces of data: error code, error message, and error details. 271 # 272 # You can find out more about this error model and how to work with it in the 273 # [API Design Guide](https://cloud.google.com/apis/design/errors). 274 "message": "A String", # A developer-facing error message, which should be in English. Any 275 # user-facing error message should be localized and sent in the 276 # google.rpc.Status.details field, or localized by the client. 277 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 278 "details": [ # A list of messages that carry the error details. There is a common set of 279 # message types for APIs to use. 280 { 281 "a_key": "", # Properties of the object. Contains field @type with type URL. 282 }, 283 ], 284 }, 285 }</pre> 286</div> 287 288</body></html>