File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
videointelligence/samples/analyze Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 2828"""
2929
3030import argparse
31- import base64
3231import io
3332
3433from google .cloud import videointelligence
@@ -180,15 +179,15 @@ def analyze_labels(path):
180179
181180
182181def analyze_labels_file (path ):
183- """ Detects labels given a file path. """
182+ """Detect labels given a file path."""
184183 video_client = videointelligence .VideoIntelligenceServiceClient ()
185184 features = [videointelligence .enums .Feature .LABEL_DETECTION ]
186185
187- with io .open (path , "rb" ) as movie :
188- content_base64 = base64 . b64encode ( movie .read () )
186+ with io .open (path , 'rb' ) as movie :
187+ input_content = movie .read ()
189188
190189 operation = video_client .annotate_video (
191- '' , features = features , input_content = content_base64 )
190+ '' , features = features , input_content = input_content )
192191 print ('\n Processing video for label annotations:' )
193192
194193 result = operation .result (timeout = 90 )
You can’t perform that action at this time.
0 commit comments