Skip to content

Commit 4e944dd

Browse files
authored
Video Intelligence region tag update [(#1639)](GoogleCloudPlatform/python-docs-samples#1639)
1 parent 83d9727 commit 4e944dd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

samples/shotchange/shotchange.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,46 +26,46 @@
2626
2727
"""
2828

29-
# [START full_tutorial]
30-
# [START imports]
29+
# [START video_shot_tutorial]
30+
# [START video_shot_tutorial_imports]
3131
import argparse
3232

3333
from google.cloud import videointelligence
34-
# [END imports]
34+
# [END video_shot_tutorial_imports]
3535

3636

3737
def analyze_shots(path):
3838
""" Detects camera shot changes. """
39-
# [START construct_request]
39+
# [START video_shot_tutorial_construct_request]
4040
video_client = videointelligence.VideoIntelligenceServiceClient()
4141
features = [videointelligence.enums.Feature.SHOT_CHANGE_DETECTION]
4242
operation = video_client.annotate_video(path, features=features)
43-
# [END construct_request]
43+
# [END video_shot_tutorial_construct_request]
4444
print('\nProcessing video for shot change annotations:')
4545

46-
# [START check_operation]
46+
# [START video_shot_tutorial_check_operation]
4747
result = operation.result(timeout=90)
4848
print('\nFinished processing.')
49-
# [END check_operation]
49+
# [END video_shot_tutorial_check_operation]
5050

51-
# [START parse_response]
51+
# [START video_shot_tutorial_parse_response]
5252
for i, shot in enumerate(result.annotation_results[0].shot_annotations):
5353
start_time = (shot.start_time_offset.seconds +
5454
shot.start_time_offset.nanos / 1e9)
5555
end_time = (shot.end_time_offset.seconds +
5656
shot.end_time_offset.nanos / 1e9)
5757
print('\tShot {}: {} to {}'.format(i, start_time, end_time))
58-
# [END parse_response]
58+
# [END video_shot_tutorial_parse_response]
5959

6060

6161
if __name__ == '__main__':
62-
# [START running_app]
62+
# [START video_shot_tutorial_run_application]
6363
parser = argparse.ArgumentParser(
6464
description=__doc__,
6565
formatter_class=argparse.RawDescriptionHelpFormatter)
6666
parser.add_argument('path', help='GCS path for shot change detection.')
6767
args = parser.parse_args()
6868

6969
analyze_shots(args.path)
70-
# [END running_app]
71-
# [END full_tutorial]
70+
# [END video_shot_tutorial_run_application]
71+
# [END video_shot_tutorial]

0 commit comments

Comments
 (0)