blob: 8e88fc87b45e8e0ee8db4d7b6ff838a2ec37fe82 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<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_v1p3beta1.html">Cloud Video Intelligence API</a> . <a href="videointelligence_v1p3beta1.videos.html">videos</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#annotate">annotate(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Performs asynchronous video annotation. Progress and results can be</p>
80<h3>Method Details</h3>
81<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070082 <code class="details" id="annotate">annotate(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070083 <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:
Dan O'Mearadd494642020-05-01 07:42:23 -070089 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 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.
Dan O'Mearadd494642020-05-01 07:42:23 -070094 "faceDetectionConfig": { # Config for FACE_DETECTION. # Config for FACE_DETECTION.
95 "model": "A String", # Model to use for face detection.
96 # Supported values: "builtin/stable" (the default if unset) and
97 # "builtin/latest".
98 "includeAttributes": True or False, # Whether to enable face attributes detection, such as glasses, dark_glasses,
99 # mouth_open etc. Ignored if 'include_bounding_boxes' is set to false.
100 "includeBoundingBoxes": True or False, # Whether bounding boxes are included in the face annotation output.
101 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700102 "shotChangeDetectionConfig": { # Config for SHOT_CHANGE_DETECTION. # Config for SHOT_CHANGE_DETECTION.
103 "model": "A String", # Model to use for shot change detection.
104 # Supported values: "builtin/stable" (the default if unset) and
105 # "builtin/latest".
106 },
107 "textDetectionConfig": { # Config for TEXT_DETECTION. # Config for TEXT_DETECTION.
108 "languageHints": [ # Language hint can be specified if the language to be detected is known a
109 # priori. It can increase the accuracy of the detection. Language hint must
110 # be language code in BCP-47 format.
111 #
112 # Automatic language detection is performed if no hint is provided.
113 "A String",
114 ],
115 "model": "A String", # Model to use for text detection.
116 # Supported values: "builtin/stable" (the default if unset) and
117 # "builtin/latest".
118 },
119 "speechTranscriptionConfig": { # Config for SPEECH_TRANSCRIPTION. # Config for SPEECH_TRANSCRIPTION.
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 "languageCode": "A String", # Required. *Required* The language of the supplied audio as a
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700121 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
122 # Example: "en-US".
123 # See [Language Support](https://cloud.google.com/speech/docs/languages)
124 # for a list of the currently supported language codes.
Dan O'Mearadd494642020-05-01 07:42:23 -0700125 "filterProfanity": True or False, # Optional. If set to `true`, the server will attempt to filter out
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700126 # profanities, replacing all but the initial character in each filtered word
127 # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
128 # won't be filtered out.
Dan O'Mearadd494642020-05-01 07:42:23 -0700129 "enableAutomaticPunctuation": True or False, # Optional. If 'true', adds punctuation to recognition result hypotheses.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700130 # This feature is only available in select languages. Setting this for
131 # requests in other languages has no effect at all. The default 'false' value
132 # does not add punctuation to result hypotheses. NOTE: "This is currently
133 # offered as an experimental service, complimentary to all users. In the
134 # future this may be exclusively available as a premium feature."
Dan O'Mearadd494642020-05-01 07:42:23 -0700135 "enableSpeakerDiarization": True or False, # Optional. If 'true', enables speaker detection for each recognized word in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 # the top alternative of the recognition result using a speaker_tag provided
137 # in the WordInfo.
138 # Note: When this is true, we send all the words from the beginning of the
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 # audio for the top alternative in every consecutive response.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700140 # This is done in order to improve our speaker tags as our models learn to
141 # identify the speakers in the conversation over time.
Dan O'Mearadd494642020-05-01 07:42:23 -0700142 "maxAlternatives": 42, # Optional. Maximum number of recognition hypotheses to be returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700143 # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
144 # within each `SpeechTranscription`. The server may return fewer than
145 # `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will
146 # return a maximum of one. If omitted, will return a maximum of one.
Dan O'Mearadd494642020-05-01 07:42:23 -0700147 "audioTracks": [ # Optional. For file formats, such as MXF or MKV, supporting multiple audio
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 # tracks, specify up to two tracks. Default: track 0.
149 42,
150 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700151 "diarizationSpeakerCount": 42, # Optional. If set, specifies the estimated number of speakers in the conversation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700152 # If not set, defaults to '2'.
153 # Ignored unless enable_speaker_diarization is set to true.
Dan O'Mearadd494642020-05-01 07:42:23 -0700154 "enableWordConfidence": True or False, # Optional. If `true`, the top result includes a list of words and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700155 # confidence for those words. If `false`, no word-level confidence
156 # information is returned. The default is `false`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700157 "speechContexts": [ # Optional. A means to provide context to assist the speech recognition.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700158 { # Provides "hints" to the speech recognizer to favor specific words and phrases
159 # in the results.
Dan O'Mearadd494642020-05-01 07:42:23 -0700160 "phrases": [ # Optional. A list of strings containing words and phrases "hints" so that
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161 # the speech recognition is more likely to recognize them. This can be used
162 # to improve the accuracy for specific words and phrases, for example, if
163 # specific commands are typically spoken by the user. This can also be used
164 # to add additional words to the vocabulary of the recognizer. See
165 # [usage limits](https://cloud.google.com/speech/limits#content).
166 "A String",
167 ],
168 },
169 ],
170 },
171 "segments": [ # Video segments to annotate. The segments may overlap and are not required
172 # to be contiguous or span the whole video. If unspecified, each video is
173 # treated as a single segment.
174 { # Video segment.
175 "endTimeOffset": "A String", # Time-offset, relative to the beginning of the video,
176 # corresponding to the end of the segment (inclusive).
177 "startTimeOffset": "A String", # Time-offset, relative to the beginning of the video,
178 # corresponding to the start of the segment (inclusive).
179 },
180 ],
181 "labelDetectionConfig": { # Config for LABEL_DETECTION. # Config for LABEL_DETECTION.
182 "labelDetectionMode": "A String", # What labels should be detected with LABEL_DETECTION, in addition to
183 # video-level labels or segment-level labels.
184 # If unspecified, defaults to `SHOT_MODE`.
185 "model": "A String", # Model to use for label detection.
186 # Supported values: "builtin/stable" (the default if unset) and
187 # "builtin/latest".
Dan O'Mearadd494642020-05-01 07:42:23 -0700188 "stationaryCamera": True or False, # Whether the video has been shot from a stationary (i.e., non-moving)
189 # camera. When set to true, might improve detection accuracy for moving
190 # objects. Should be used with `SHOT_AND_FRAME_MODE` enabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 "frameConfidenceThreshold": 3.14, # The confidence threshold we perform filtering on the labels from
192 # frame-level detection. If not set, it is set to 0.4 by default. The valid
193 # range for this threshold is [0.1, 0.9]. Any value set outside of this
194 # range will be clipped.
Dan O'Mearadd494642020-05-01 07:42:23 -0700195 # Note: For best results, follow the default threshold. We will update
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700196 # the default threshold everytime when we release a new model.
197 "videoConfidenceThreshold": 3.14, # The confidence threshold we perform filtering on the labels from
Dan O'Mearadd494642020-05-01 07:42:23 -0700198 # video-level and shot-level detections. If not set, it's set to 0.3 by
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700199 # default. The valid range for this threshold is [0.1, 0.9]. Any value set
200 # outside of this range will be clipped.
Dan O'Mearadd494642020-05-01 07:42:23 -0700201 # Note: For best results, follow the default threshold. We will update
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700202 # the default threshold everytime when we release a new model.
203 },
204 "explicitContentDetectionConfig": { # Config for EXPLICIT_CONTENT_DETECTION. # Config for EXPLICIT_CONTENT_DETECTION.
205 "model": "A String", # Model to use for explicit content detection.
206 # Supported values: "builtin/stable" (the default if unset) and
207 # "builtin/latest".
208 },
209 "objectTrackingConfig": { # Config for OBJECT_TRACKING. # Config for OBJECT_TRACKING.
210 "model": "A String", # Model to use for object tracking.
211 # Supported values: "builtin/stable" (the default if unset) and
212 # "builtin/latest".
213 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700214 "personDetectionConfig": { # Config for PERSON_DETECTION. # Config for PERSON_DETECTION.
215 "includePoseLandmarks": True or False, # Whether to enable pose landmarks detection. Ignored if
216 # 'include_bounding_boxes' is set to false.
217 "includeAttributes": True or False, # Whether to enable person attributes detection, such as cloth color (black,
218 # blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair,
219 # etc.
220 # Ignored if 'include_bounding_boxes' is set to false.
221 "includeBoundingBoxes": True or False, # Whether bounding boxes are included in the person detection annotation
222 # output.
223 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700224 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700225 "features": [ # Required. Requested video annotation features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700226 "A String",
227 ],
228 "inputContent": "A String", # The video data bytes.
Dan O'Mearadd494642020-05-01 07:42:23 -0700229 # If unset, the input video(s) should be specified via the `input_uri`.
230 # If set, `input_uri` must be unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700231 "inputUri": "A String", # Input video location. Currently, only
Dan O'Mearadd494642020-05-01 07:42:23 -0700232 # [Cloud Storage](https://cloud.google.com/storage/) URIs are
233 # supported. URIs must be specified in the following format:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700234 # `gs://bucket-id/object-id` (other URI formats return
235 # google.rpc.Code.INVALID_ARGUMENT). For more information, see
Dan O'Mearadd494642020-05-01 07:42:23 -0700236 # [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
237 # To identify multiple videos, a video URI may include wildcards in the
238 # `object-id`. Supported wildcards: '*' to match 0 or more characters;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700239 # '?' to match 1 character. If unset, the input video should be embedded
Dan O'Mearadd494642020-05-01 07:42:23 -0700240 # in the request as `input_content`. If set, `input_content` must be unset.
241 "locationId": "A String", # Optional. Cloud region where annotation should take place. Supported cloud
242 # regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no
243 # region is specified, the region will be determined based on video file
244 # location.
245 "outputUri": "A String", # Optional. Location where the output (in JSON format) should be stored.
246 # Currently, only [Cloud Storage](https://cloud.google.com/storage/)
247 # URIs are supported. These must be specified in the following format:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700248 # `gs://bucket-id/object-id` (other URI formats return
249 # google.rpc.Code.INVALID_ARGUMENT). For more information, see
Dan O'Mearadd494642020-05-01 07:42:23 -0700250 # [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700251 }
252
253 x__xgafv: string, V1 error format.
254 Allowed values
255 1 - v1 error format
256 2 - v2 error format
257
258Returns:
259 An object of the form:
260
261 { # This resource represents a long-running operation that is the result of a
262 # network API call.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700263 "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.
264 # different programming environments, including REST APIs and RPC APIs. It is
265 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
266 # three pieces of data: error code, error message, and error details.
267 #
268 # You can find out more about this error model and how to work with it in the
269 # [API Design Guide](https://cloud.google.com/apis/design/errors).
270 "message": "A String", # A developer-facing error message, which should be in English. Any
271 # user-facing error message should be localized and sent in the
272 # google.rpc.Status.details field, or localized by the client.
273 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
274 "details": [ # A list of messages that carry the error details. There is a common set of
275 # message types for APIs to use.
276 {
277 "a_key": "", # Properties of the object. Contains field @type with type URL.
278 },
279 ],
280 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700281 "done": True or False, # If the value is `false`, it means the operation is still in progress.
282 # If `true`, the operation is completed, and either `error` or `response` is
283 # available.
284 "response": { # The normal response of the operation in case of success. If the original
285 # method returns no data on success, such as `Delete`, the response is
286 # `google.protobuf.Empty`. If the original method is standard
287 # `Get`/`Create`/`Update`, the response should be the resource. For other
288 # methods, the response should have the type `XxxResponse`, where `Xxx`
289 # is the original method name. For example, if the original method name
290 # is `TakeSnapshot()`, the inferred response type is
291 # `TakeSnapshotResponse`.
292 "a_key": "", # Properties of the object. Contains field @type with type URL.
293 },
294 "name": "A String", # The server-assigned name, which is only unique within the same service that
295 # originally returns it. If you use the default HTTP mapping, the
296 # `name` should be a resource name ending with `operations/{unique_id}`.
297 "metadata": { # Service-specific metadata associated with the operation. It typically
298 # contains progress information and common metadata such as create time.
299 # Some services might not provide such metadata. Any method that returns a
300 # long-running operation should document the metadata type, if any.
301 "a_key": "", # Properties of the object. Contains field @type with type URL.
302 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700303 }</pre>
304</div>
305
306</body></html>