Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extract faces grayscale #1276

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions deepface/DeepFace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
6 changes: 3 additions & 3 deletions deepface/modules/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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,
Expand Down