Skip to content

Commit

Permalink
fix: changes positional to named pararameters in Video samples [(#4017)…
Browse files Browse the repository at this point in the history
…](#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)
```
  • Loading branch information
telpirion authored and danoscarmike committed Sep 30, 2020
1 parent f66743c commit a62a8ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions videointelligence/samples/analyze/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:")

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit a62a8ac

Please sign in to comment.