From cdfbd765afd7a69796f4e065a953bbcb90f73398 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 9 Jun 2020 11:40:08 -0700 Subject: [PATCH] fix: changes positional to named pararameters in Video samples [(#4017)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/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) ``` --- videointelligence/samples/analyze/analyze.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/videointelligence/samples/analyze/analyze.py b/videointelligence/samples/analyze/analyze.py index 75bf3248a67a..85a536e1cb5a 100644 --- a/videointelligence/samples/analyze/analyze.py +++ b/videointelligence/samples/analyze/analyze.py @@ -44,7 +44,7 @@ def analyze_explicit_content(path): video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.enums.Feature.EXPLICIT_CONTENT_DETECTION] - operation = video_client.annotate_video(path, features=features) + operation = video_client.annotate_video(input_uri=path, features=features) print("\nProcessing video for explicit content annotations:") result = operation.result(timeout=90) @@ -70,7 +70,7 @@ def analyze_labels(path): context = videointelligence.types.VideoContext(label_detection_config=config) operation = video_client.annotate_video( - path, features=features, video_context=context + input_uri=path, features=features, video_context=context ) print("\nProcessing video for label annotations:") @@ -233,7 +233,7 @@ def analyze_shots(path): """ Detects camera shot changes. """ video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.enums.Feature.SHOT_CHANGE_DETECTION] - operation = video_client.annotate_video(path, features=features) + operation = video_client.annotate_video(input_uri=path, features=features) print("\nProcessing video for shot change annotations:") result = operation.result(timeout=90) @@ -263,7 +263,7 @@ def speech_transcription(path): ) operation = video_client.annotate_video( - path, features=features, video_context=video_context + input_uri=path, features=features, video_context=video_context ) print("\nProcessing video for speech transcription.")