Skip to content

Instantly share code, notes, and snippets.

@alonlavian
Created April 24, 2019 17:40
Show Gist options
  • Save alonlavian/43097c3acfc7b9f85b11d810df2e42af to your computer and use it in GitHub Desktop.
Save alonlavian/43097c3acfc7b9f85b11d810df2e42af to your computer and use it in GitHub Desktop.
face detection annotation with google vision
from google.cloud import vision
from google.cloud.vision import types
def detect_face(face_file, max_results=4):
client = vision.ImageAnnotatorClient()
content = face_file.read()
image = types.Image(content=content)
return client.face_detection(image=image, max_results=max_results).face_annotations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment