Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Choose recognition model for face detect #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cognitive_face/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import util


def detect(image, face_id=True, landmarks=False, attributes=''):
def detect(image, face_id=True, landmarks=False, attributes='', recognitionModel="recognition_01"):
"""Detect human faces in an image and returns face locations, and
optionally with `face_id`s, landmarks, and attributes.

Expand All @@ -23,7 +23,8 @@ def detect(image, face_id=True, landmarks=False, attributes=''):
headPose, smile, facialHair, glasses, emotion, makeup, accessories,
occlusion, blur, exposure, noise. Note that each face attribute
analysis has additional computational and time cost.

recognitionModel: [Optional] Specify the recognition model to use.

Returns:
An array of face entries ranked by face rectangle size in descending
order. An empty response indicates no faces detected. A face entry may
Expand All @@ -35,6 +36,7 @@ def detect(image, face_id=True, landmarks=False, attributes=''):
'returnFaceId': face_id and 'true' or 'false',
'returnFaceLandmarks': landmarks and 'true' or 'false',
'returnFaceAttributes': attributes,
'recognitionModel': recognitionModel,
}

return util.request(
Expand Down