def highlight_faces(image, faces, output_filename):
 im = Image.open(image)
 draw = ImageDraw.Draw(im)
 for face in faces:
  box = [(v.get('x', 0.0), v.get('y', 0.0)) for v in face['fdBoundingPoly']['vertices']]
  draw.line((box + [box[0]]), width=5, fill='#00ff00')
 im.save(output_filename)

def highlight_faces ( image , faces , output_filename ) : im = Image . open ( image ) draw = ImageDraw . Draw ( im ) for face in faces : box = [ ( v . get ( 'x' , 0.0 ) , v . get ( 'y' , 0.0 ) ) for v in face [ 'fdBoundingPoly' ] [ 'vertices' ] ] draw . line ( ( box + [ box [ 0 ] ] ) , width = 5 , fill = '#00ff00' ) im . save ( output_filename )
draws a polygon around the faces .