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
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 Jun 9, 2020
1 parent bc5a533 commit c9d0c9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions video/cloud-client/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
2 changes: 1 addition & 1 deletion video/cloud-client/labels/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def analyze_labels(path):
# [START video_label_tutorial_construct_request]
video_client = videointelligence.VideoIntelligenceServiceClient()
features = [videointelligence.enums.Feature.LABEL_DETECTION]
operation = video_client.annotate_video(path, features=features)
operation = video_client.annotate_video(input_uri=path, features=features)
# [END video_label_tutorial_construct_request]
print('\nProcessing video for label annotations:')

Expand Down
2 changes: 1 addition & 1 deletion video/cloud-client/shotchange/shotchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def analyze_shots(path):
# [START video_shot_tutorial_construct_request]
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)
# [END video_shot_tutorial_construct_request]
print('\nProcessing video for shot change annotations:')

Expand Down

0 comments on commit c9d0c9b

Please sign in to comment.