docstring

This commit is contained in:
Sefik Ilkin Serengil 2023-02-24 12:05:13 +00:00 committed by GitHub
parent 75f3eb7577
commit 7414066a73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -817,6 +817,35 @@ def extract_faces(
def detectFace(
img_path, target_size=(224, 224), detector_backend="opencv", enforce_detection=True, align=True
):
"""
Deprecated function. Use extract_faces for same functionality.
This function applies pre-processing stages of a face recognition pipeline
including detection and alignment
Parameters:
img_path: exact image path, numpy array (BGR) or base64 encoded image.
Source image can have many face. Then, result will be the size of number
of faces appearing in that source image.
target_size (tuple): final shape of facial image. black pixels will be
added to resize the image.
detector_backend (string): face detection backends are retinaface, mtcnn,
opencv, ssd or dlib
enforce_detection (boolean): function throws exception if face cannot be
detected in the fed image. Set this to False if you do not want to get
an exception and run the function anyway.
align (boolean): alignment according to the eye positions.
grayscale (boolean): extracting faces in rgb or gray scale
Returns:
detected and aligned face as numpy array
"""
print("⚠️ Function detectFace is deprecated. Use extract_faces instead.")
face_objs = extract_faces(
img_path=img_path,