diff --git a/videointelligence/samples/analyze/analyze.py b/videointelligence/samples/analyze/analyze.py index cbe700c5b4be..cd9a0633c27b 100644 --- a/videointelligence/samples/analyze/analyze.py +++ b/videointelligence/samples/analyze/analyze.py @@ -32,9 +32,12 @@ """ import argparse + +# [START video_detect_text] import io from google.cloud import videointelligence +# [END video_detect_text] def analyze_explicit_content(path): @@ -357,11 +360,10 @@ def video_detect_text_gcs(input_uri): # [END video_detect_text_gcs] +# [START video_detect_text] def video_detect_text(path): - # [START video_detect_text] - """Detect text in a local video.""" - from google.cloud import videointelligence + """Detect text in a local video.""" video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.Feature.TEXT_DETECTION] video_context = videointelligence.VideoContext() @@ -410,7 +412,7 @@ def video_detect_text(path): print("Rotated Bounding Box Vertices:") for vertex in frame.rotated_bounding_box.vertices: print("\tVertex.x: {}, Vertex.y: {}".format(vertex.x, vertex.y)) - # [END video_detect_text] +# [END video_detect_text] def track_objects_gcs(gcs_uri):