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: Skip face-swapping for images without detectable faces (#504) #508

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rohitsainier
Copy link

  • Added logic to skip processing for images with no detected faces.
  • Ensured face-swapping is applied only to images with valid face detections.

Closes #504

@rohitsainier
Copy link
Author

@Gourieff I have raised a new PR.
Please review it
it includes only the necessary code changes without any formatting updates.


if len(faces) == 0:
logger.status("No face found so skipping this frame")
return faces
# Try halving det_size if no faces are found
if len(faces) == 0 and det_size[0] > 320 and det_size[1] > 320:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code will no longer be executed because for the condition len(faces) == 0 to be true, you will already have returned from the function in the previous if block. Put your new code from above in an elseif on this if instead to avoid breaking this functionality.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated @Wiikend92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reactor fails on MacOs with error : CoreML static output shape and inferred shape have different ranks.
2 participants