Skip to content

Commit fae1669

Browse files
authored
Video Intelligence region tag update [(#1639)](GoogleCloudPlatform/python-docs-samples#1639)
1 parent 92695d6 commit fae1669

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

samples/labels/labels.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,29 @@
2727
2828
"""
2929

30-
# [START full_tutorial]
31-
# [START imports]
30+
# [START video_label_tutorial]
31+
# [START video_label_tutorial_imports]
3232
import argparse
3333

3434
from google.cloud import videointelligence
35-
# [END imports]
35+
# [END video_label_tutorial_imports]
3636

3737

3838
def analyze_labels(path):
3939
""" Detects labels given a GCS path. """
40-
# [START construct_request]
40+
# [START video_label_tutorial_construct_request]
4141
video_client = videointelligence.VideoIntelligenceServiceClient()
4242
features = [videointelligence.enums.Feature.LABEL_DETECTION]
4343
operation = video_client.annotate_video(path, features=features)
44-
# [END construct_request]
44+
# [END video_label_tutorial_construct_request]
4545
print('\nProcessing video for label annotations:')
4646

47-
# [START check_operation]
47+
# [START video_label_tutorial_check_operation]
4848
result = operation.result(timeout=90)
4949
print('\nFinished processing.')
50-
# [END check_operation]
50+
# [END video_label_tutorial_check_operation]
5151

52-
# [START parse_response]
52+
# [START video_label_tutorial_parse_response]
5353
segment_labels = result.annotation_results[0].segment_label_annotations
5454
for i, segment_label in enumerate(segment_labels):
5555
print('Video label description: {}'.format(
@@ -68,17 +68,17 @@ def analyze_labels(path):
6868
print('\tSegment {}: {}'.format(i, positions))
6969
print('\tConfidence: {}'.format(confidence))
7070
print('\n')
71-
# [END parse_response]
71+
# [END video_label_tutorial_parse_response]
7272

7373

7474
if __name__ == '__main__':
75-
# [START running_app]
75+
# [START video_label_tutorial_run_application]
7676
parser = argparse.ArgumentParser(
7777
description=__doc__,
7878
formatter_class=argparse.RawDescriptionHelpFormatter)
7979
parser.add_argument('path', help='GCS file path for label detection.')
8080
args = parser.parse_args()
8181

8282
analyze_labels(args.path)
83-
# [END running_app]
84-
# [END full_tutorial]
83+
# [END video_label_tutorial_run_application]
84+
# [END video_label_tutorial]

0 commit comments

Comments
 (0)