Skip to content

Commit c9d0c9b

Browse files
authored
fix: changes positional to named pararameters in Video samples (#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 bc5a533 commit c9d0c9b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

video/cloud-client/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.")

video/cloud-client/labels/labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def analyze_labels(path):
4040
# [START video_label_tutorial_construct_request]
4141
video_client = videointelligence.VideoIntelligenceServiceClient()
4242
features = [videointelligence.enums.Feature.LABEL_DETECTION]
43-
operation = video_client.annotate_video(path, features=features)
43+
operation = video_client.annotate_video(input_uri=path, features=features)
4444
# [END video_label_tutorial_construct_request]
4545
print('\nProcessing video for label annotations:')
4646

video/cloud-client/shotchange/shotchange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def analyze_shots(path):
3939
# [START video_shot_tutorial_construct_request]
4040
video_client = videointelligence.VideoIntelligenceServiceClient()
4141
features = [videointelligence.enums.Feature.SHOT_CHANGE_DETECTION]
42-
operation = video_client.annotate_video(path, features=features)
42+
operation = video_client.annotate_video(input_uri=path, features=features)
4343
# [END video_shot_tutorial_construct_request]
4444
print('\nProcessing video for shot change annotations:')
4545

0 commit comments

Comments
 (0)