Skip to content

Commit cdfbd76

Browse files
telpirionleahecole
authored andcommitted
fix: changes positional to named pararameters in Video samples [(#4017)](#4017)
Changes calls to `VideoClient.annotate_video()` so that GCS URIs are provided as named parameters. Example: ``` operation = video_client.annotate_video(path, features=features) ``` Becomes: ``` operation = video_client.annotate_video(input_uri=path, features=features) ```
1 parent c3b1d23 commit cdfbd76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

videointelligence/samples/analyze/analyze.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def analyze_explicit_content(path):
4444
video_client = videointelligence.VideoIntelligenceServiceClient()
4545
features = [videointelligence.enums.Feature.EXPLICIT_CONTENT_DETECTION]
4646

47-
operation = video_client.annotate_video(path, features=features)
47+
operation = video_client.annotate_video(input_uri=path, features=features)
4848
print("\nProcessing video for explicit content annotations:")
4949

5050
result = operation.result(timeout=90)
@@ -70,7 +70,7 @@ def analyze_labels(path):
7070
context = videointelligence.types.VideoContext(label_detection_config=config)
7171

7272
operation = video_client.annotate_video(
73-
path, features=features, video_context=context
73+
input_uri=path, features=features, video_context=context
7474
)
7575
print("\nProcessing video for label annotations:")
7676

@@ -233,7 +233,7 @@ def analyze_shots(path):
233233
""" Detects camera shot changes. """
234234
video_client = videointelligence.VideoIntelligenceServiceClient()
235235
features = [videointelligence.enums.Feature.SHOT_CHANGE_DETECTION]
236-
operation = video_client.annotate_video(path, features=features)
236+
operation = video_client.annotate_video(input_uri=path, features=features)
237237
print("\nProcessing video for shot change annotations:")
238238

239239
result = operation.result(timeout=90)
@@ -263,7 +263,7 @@ def speech_transcription(path):
263263
)
264264

265265
operation = video_client.annotate_video(
266-
path, features=features, video_context=video_context
266+
input_uri=path, features=features, video_context=video_context
267267
)
268268

269269
print("\nProcessing video for speech transcription.")

0 commit comments

Comments
 (0)