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

Can I remove everything but faces? #159

Open
alkinnon opened this issue Oct 3, 2022 · 4 comments
Open

Can I remove everything but faces? #159

alkinnon opened this issue Oct 3, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@alkinnon
Copy link

alkinnon commented Oct 3, 2022

Hi, as part of a student games dev project, I'm looking for a linux solution which will remove everything but a face from the image, leaving only the face, and transparent alpha channel ideally.

Can backscrub extract just faces?

The virtual cam output can then be read within a browser 2D platform game for further processing (using players face on their actual player character) .

@floe
Copy link
Owner

floe commented Oct 3, 2022

Interesting question - this won't work out-of-the-box, because all the ML models are trained to segment persons and not faces. But you could try a two-step approach, where you take the person outline from backscrub, and then run a dedicated face detector such as described in https://docs.opencv.org/4.2.0/db/d28/tutorial_cascade_classifier.html (and then just take the intersection of the two regions).

@floe floe added the enhancement New feature or request label Oct 3, 2022
@BenBE
Copy link
Collaborator

BenBE commented Oct 4, 2022

Also if you take a compatible model that only marks faces in the image this might even work with backscrub directly. But depending on the model you will likely need to adapt some stuff to properly integrate the model with the internal processing pipeline we use.

@alkinnon
Copy link
Author

alkinnon commented Oct 4, 2022

Thanks for the comments. interesting things to look into!

@floe
Copy link
Owner

floe commented Oct 4, 2022

Ah wait, now I remember that body-pix actually does separate classes for body parts, including head. That might work almost out of the box.

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

No branches or pull requests

3 participants