Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review feedback
  • Loading branch information
gguuss committed May 15, 2017
commit 4c586182c99faf51141f17a40a0b98d15e956525
17 changes: 9 additions & 8 deletions video/cloud-client/analyze/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import argparse
import base64
import io
import sys
import time

Expand All @@ -48,7 +49,7 @@ def analyze_safe_search(path):
while not operation.done():
sys.stdout.write('.')
sys.stdout.flush()
time.sleep(1)
time.sleep(15)

print('\nFinished processing.')

Expand Down Expand Up @@ -79,7 +80,7 @@ def analyze_faces(path):
while not operation.done():
sys.stdout.write('.')
sys.stdout.flush()
time.sleep(1)
time.sleep(15)

print('\nFinished processing.')

Expand Down Expand Up @@ -114,7 +115,7 @@ def analyze_labels(path):
while not operation.done():
sys.stdout.write('.')
sys.stdout.flush()
time.sleep(1)
time.sleep(15)

print('\nFinished processing.')

Expand Down Expand Up @@ -143,17 +144,17 @@ def analyze_labels_file(path):
VideoIntelligenceServiceClient())
features = [enums.Feature.LABEL_DETECTION]

with open(path, "rb") as movie:
with io.open(path, "rb") as movie:
content_base64 = base64.b64encode(movie.read())

operation = video_client.annotate_video('', features,
input_content=content_base64)
operation = video_client.annotate_video(
'', features, input_content=content_base64)
print('\nProcessing video for label annotations:')

while not operation.done():
sys.stdout.write('.')
sys.stdout.flush()
time.sleep(1)
time.sleep(15)

print('\nFinished processing.')

Expand Down Expand Up @@ -187,7 +188,7 @@ def analyze_shots(path):
while not operation.done():
sys.stdout.write('.')
sys.stdout.flush()
time.sleep(1)
time.sleep(15)

print('\nFinished processing.')

Expand Down
2 changes: 2 additions & 0 deletions video/cloud-client/analyze/analyze_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
import os

import analyze

import pytest


BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
LABELS_FILE_PATH = '/video/cat.mp4'
FACES_FILE_PATH = '/video/googlework.mp4'
Expand Down