diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index 0ac2be501..327f9a888 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -503,8 +503,8 @@ def extract_faces( expand_percentage (int): expand detected facial area with a percentage (default is 0). - grayscale (boolean): Flag to convert the image to grayscale before - processing (default is False). + grayscale (boolean): Flag to convert the output face image to grayscale + (default is False). anti_spoofing (boolean): Flag to enable anti spoofing (default is False). diff --git a/deepface/modules/detection.py b/deepface/modules/detection.py index 6598bbf2a..76daa0847 100644 --- a/deepface/modules/detection.py +++ b/deepface/modules/detection.py @@ -45,8 +45,8 @@ def extract_faces( expand_percentage (int): expand detected facial area with a percentage - grayscale (boolean): Flag to convert the image to grayscale before - processing (default is False). + grayscale (boolean): Flag to convert the output face image to grayscale + (default is False). anti_spoofing (boolean): Flag to enable anti spoofing (default is False). @@ -125,7 +125,7 @@ def extract_faces( h = int(current_region.h) resp_obj = { - "face": current_img[:, :, ::-1], + "face": current_img if grayscale else current_img[:, :, ::-1], "facial_area": { "x": x, "y": y,