Created
April 24, 2019 17:40
-
-
Save alonlavian/43097c3acfc7b9f85b11d810df2e42af to your computer and use it in GitHub Desktop.
face detection annotation with google vision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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