Skip to content
Merged
Changes from all commits
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
9 changes: 4 additions & 5 deletions video/cloud-client/analyze/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"""

import argparse
import base64
import io

from google.cloud import videointelligence
Expand Down Expand Up @@ -180,15 +179,15 @@ def analyze_labels(path):


def analyze_labels_file(path):
""" Detects labels given a file path. """
"""Detect labels given a file path."""
video_client = videointelligence.VideoIntelligenceServiceClient()
features = [videointelligence.enums.Feature.LABEL_DETECTION]

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

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

result = operation.result(timeout=90)
Expand Down