File tree 1 file changed +4
-5
lines changed
video/cloud-client/analyze 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 28
28
"""
29
29
30
30
import argparse
31
- import base64
32
31
import io
33
32
34
33
from google .cloud import videointelligence
@@ -180,15 +179,15 @@ def analyze_labels(path):
180
179
181
180
182
181
def analyze_labels_file (path ):
183
- """ Detects labels given a file path. """
182
+ """Detect labels given a file path."""
184
183
video_client = videointelligence .VideoIntelligenceServiceClient ()
185
184
features = [videointelligence .enums .Feature .LABEL_DETECTION ]
186
185
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 ()
189
188
190
189
operation = video_client .annotate_video (
191
- '' , features = features , input_content = content_base64 )
190
+ '' , features = features , input_content = input_content )
192
191
print ('\n Processing video for label annotations:' )
193
192
194
193
result = operation .result (timeout = 90 )
You can’t perform that action at this time.
0 commit comments