Skip to content

fix python2 print unicode issue #2183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
12 changes: 8 additions & 4 deletions video/cloud-client/analyze/beta_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def track_objects_gcs(gcs_uri):

# Get only the first annotation for demo purposes.
object_annotation = object_annotations[0]
print('Entity description: {}'.format(
# description is in Unicode
print(u'Entity description: {}'.format(
object_annotation.entity.description))
if object_annotation.entity.entity_id:
print('Entity id: {}'.format(object_annotation.entity.entity_id))
Expand Down Expand Up @@ -259,7 +260,8 @@ def track_objects(path):

# Get only the first annotation for demo purposes.
object_annotation = object_annotations[0]
print('Entity description: {}'.format(
# description is in Unicode
print(u'Entity description: {}'.format(
object_annotation.entity.description))
if object_annotation.entity.entity_id:
print('Entity id: {}'.format(object_annotation.entity.entity_id))
Expand Down Expand Up @@ -343,7 +345,8 @@ def stream_generator():
description = annotation.entity.description
# Every annotation has only one frame
confidence = annotation.frames[0].confidence
print('\t{} (confidence: {})'.format(description, confidence))
# description is in Unicode
print(u'\t{} (confidence: {})'.format(description, confidence))
# [END video_streaming_label_detection_beta]


Expand Down Expand Up @@ -463,7 +466,8 @@ def stream_generator():
# track_id tracks the same object in the video.
track_id = annotation.track_id

print('\tEntity description: {}'.format(description))
# description is in Unicode
print(u'\tEntity description: {}'.format(description))
print('\tTrack Id: {}'.format(track_id))
if annotation.entity.entity_id:
print('\tEntity id: {}'.format(annotation.entity.entity_id))
Expand Down