def detect_labels(path):
 vision_client = vision.Client()
 with io.open(path, 'rb') as image_file:
  content = image_file.read()
 image = vision_client.image(content=content)
 labels = image.detect_labels()
 print 'Labels:'
 for label in labels:
  print label.description

def detect_labels ( path ) : vision_client = vision . Client ( ) with io . open ( path , 'rb' ) as image_file : content = image_file . read ( ) image = vision_client . image ( content = content ) labels = image . detect_labels ( ) print 'Labels:' for label in labels : print label . description
detects labels in the file .