Merge pull request #1276 from ProgramadorArtificial/bugfix/extract_faces_grayscale

Fix extract faces grayscale
This commit is contained in:
Sefik Ilkin Serengil 2024-07-13 21:40:41 +01:00 committed by GitHub
commit b75e37c3f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -503,8 +503,8 @@ def extract_faces(
expand_percentage (int): expand detected facial area with a percentage (default is 0). expand_percentage (int): expand detected facial area with a percentage (default is 0).
grayscale (boolean): Flag to convert the image to grayscale before grayscale (boolean): Flag to convert the output face image to grayscale
processing (default is False). (default is False).
anti_spoofing (boolean): Flag to enable anti spoofing (default is False). anti_spoofing (boolean): Flag to enable anti spoofing (default is False).

View File

@ -45,8 +45,8 @@ def extract_faces(
expand_percentage (int): expand detected facial area with a percentage expand_percentage (int): expand detected facial area with a percentage
grayscale (boolean): Flag to convert the image to grayscale before grayscale (boolean): Flag to convert the output face image to grayscale
processing (default is False). (default is False).
anti_spoofing (boolean): Flag to enable anti spoofing (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) h = int(current_region.h)
resp_obj = { resp_obj = {
"face": current_img[:, :, ::-1], "face": current_img if grayscale else current_img[:, :, ::-1],
"facial_area": { "facial_area": {
"x": x, "x": x,
"y": y, "y": y,