def detect_faces(path):
 vision_client = vision.Client()
 with io.open(path, 'rb') as image_file:
  content = image_file.read()
 image = vision_client.image(content=content)
 faces = image.detect_faces()
 print 'Faces:'
 for face in faces:
  print 'anger: {}'.format(face.emotions.anger)
  print 'joy: {}'.format(face.emotions.joy)
  print 'surprise: {}'.format(face.emotions.surprise)

def detect_faces ( path ) : vision_client = vision . Client ( ) with io . open ( path , 'rb' ) as image_file : content = image_file . read ( ) image = vision_client . image ( content = content ) faces = image . detect_faces ( ) print 'Faces:' for face in faces : print 'anger: {}' . format ( face . emotions . anger ) print 'joy: {}' . format ( face . emotions . joy ) print 'surprise: {}' . format ( face . emotions . surprise )
detects faces in an image .