-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Feature/custom output extract faces #1279
Feature/custom output extract faces #1279
Conversation
@serengil |
Added grayscale parameter again. If False obey color_face, if True obey grayscale and return a warning: |
deepface/modules/verification.py
Outdated
@@ -239,7 +239,8 @@ def __extract_faces_and_embeddings( | |||
img_objs = detection.extract_faces( | |||
img_path=img_path, | |||
detector_backend=detector_backend, | |||
grayscale=False, | |||
color_face='rgb', | |||
normalize_face=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default values of color face and normalize face are rgb and True already, IMO we should not set them where it is being called if we are setting default values.
this is available also in representation, recognition, and more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed them. I added it because grayscale was there.
deepface/modules/verification.py
Outdated
@@ -239,7 +239,6 @@ def __extract_faces_and_embeddings( | |||
img_objs = detection.extract_faces( | |||
img_path=img_path, | |||
detector_backend=detector_backend, | |||
grayscale=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this please
deepface/modules/representation.py
Outdated
@@ -71,7 +71,6 @@ def represent( | |||
img_objs = detection.extract_faces( | |||
img_path=img_path, | |||
detector_backend=detector_backend, | |||
grayscale=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this please
deepface/modules/recognition.py
Outdated
@@ -364,7 +363,6 @@ def __find_bulk_embeddings( | |||
img_objs = detection.extract_faces( | |||
img_path=employee, | |||
detector_backend=detector_backend, | |||
grayscale=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this please
deepface/modules/recognition.py
Outdated
@@ -240,7 +240,6 @@ def find( | |||
source_objs = detection.extract_faces( | |||
img_path=img_path, | |||
detector_backend=detector_backend, | |||
grayscale=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this please
What has been done
Changed extract_faces parameters to be possible to return face image (croped) as rgb, bgr or grayscale and flag for normalized. By default, all parameters will return the same as before (RGB and normalized).
How to test
Change parameters as desired:
After extracting face can save to see the result: