29
29
30
30
import argparse
31
31
import base64
32
+ import io
32
33
import sys
33
34
import time
34
35
@@ -48,7 +49,7 @@ def analyze_safe_search(path):
48
49
while not operation .done ():
49
50
sys .stdout .write ('.' )
50
51
sys .stdout .flush ()
51
- time .sleep (1 )
52
+ time .sleep (15 )
52
53
53
54
print ('\n Finished processing.' )
54
55
@@ -79,7 +80,7 @@ def analyze_faces(path):
79
80
while not operation .done ():
80
81
sys .stdout .write ('.' )
81
82
sys .stdout .flush ()
82
- time .sleep (1 )
83
+ time .sleep (15 )
83
84
84
85
print ('\n Finished processing.' )
85
86
@@ -114,7 +115,7 @@ def analyze_labels(path):
114
115
while not operation .done ():
115
116
sys .stdout .write ('.' )
116
117
sys .stdout .flush ()
117
- time .sleep (1 )
118
+ time .sleep (15 )
118
119
119
120
print ('\n Finished processing.' )
120
121
@@ -143,17 +144,17 @@ def analyze_labels_file(path):
143
144
VideoIntelligenceServiceClient ())
144
145
features = [enums .Feature .LABEL_DETECTION ]
145
146
146
- with open (path , "rb" ) as movie :
147
+ with io . open (path , "rb" ) as movie :
147
148
content_base64 = base64 .b64encode (movie .read ())
148
149
149
- operation = video_client .annotate_video ('' , features ,
150
- input_content = content_base64 )
150
+ operation = video_client .annotate_video (
151
+ '' , features , input_content = content_base64 )
151
152
print ('\n Processing video for label annotations:' )
152
153
153
154
while not operation .done ():
154
155
sys .stdout .write ('.' )
155
156
sys .stdout .flush ()
156
- time .sleep (1 )
157
+ time .sleep (15 )
157
158
158
159
print ('\n Finished processing.' )
159
160
@@ -187,7 +188,7 @@ def analyze_shots(path):
187
188
while not operation .done ():
188
189
sys .stdout .write ('.' )
189
190
sys .stdout .flush ()
190
- time .sleep (1 )
191
+ time .sleep (15 )
191
192
192
193
print ('\n Finished processing.' )
193
194
0 commit comments