Add option to process all detected faces within a frame
I've added the ability to swap all of the faces in a frame. This is useful of you want to face swap a video with multiple people within it. It adds the ability to edit the resulting video in a NLE without having to preprocess the video to isolate each face.
A mind blowing addition for VR videos! We have to check your branch before merging it.
I guess the use case works for VR. My intention was to faceswap a longer video (like a movie) and then isolate the swapped face in an editor. Instead of isolating first.
My reasoning is to do multiple faces and then editing together at once.
Please resolve the conflicts... can you provide an example file?
Now looking into your branch
@henryruhs conflicts resolved
I don't want to be too picky but please align the checkboxes... they look wild :D
@henryruhs It looks good on my end. I'm guessing you're using Windows? Python on Windows has a lot of inconsistencies when compared to all other platforms. I can try to make it look consistent on Windows, but I don't have a Windows system to test with.
@henryruhs I merged the change that "should" fix it, if not then I don't have a way to test the appearance and can't fix the UI elements on my end
SimSwap provides a method to identify different faces (creating an identity vector for each face) and use a method to match a face to another face within an identity threshold. @CeeBeeEh Could you please explain what do you mean by VR Mode and NLE references in your post?
@Mayorc1978 I didn't set the title to VR. I believe it was done to match up with this enhancement request #178
As for the NLE comment, I realize after the fact that my comment is confusing. I simply meant it would make putting together a video with multiple swaps simpler by editing together the resulting videos in something like Kdenlive or After Effects.
Okay, so there was a misunderstanding? Can you please provide an example before and after video?
Merge conflicts appear again... sorry
@henryruhs I resolved the conflicts and I think I found a solution for the checkbox alignment issue that should work across all platforms.
As for a before/after video, it would just be all the faces in a video being swapped.
The idea is this: Souce: video with multiple people, I want to swap each one to a different person (let's say three individuals)
I have two options: Edit the source video three separate times to mask out all faces except for one person. Run Roop for each video/face. Edit the results back into a single video for desired result.
Better (IMO) option: Swap all the faces in source video. So run the video for each target face. Pull all the results into editor and mask out each face I want in the final video.
Basically this merge gives two options: swap all faces just for a fun video, or simpler workflow to do multi-person face swaps.
Edit: sorry about the odd commits, I initially messed up the merge on my local dev system.
Thanks, I made a proper code review... hopefully not too strict for a POC but we like to move forward to clean code
set target branch to next
"set target branch to next"
Done
Made the requested changes. I went with "get_face_single" and "get_face_many" to make it consistent and to read a bit better. I also refactored the swapper.py file to split the code into smaller functions and to create fewer copies of the frame object.
is this working now? multi face support is enabled?
Now that I tested it on the next branch and made sure this is working, I have to give credit to @CeeBeeEh for this addition. Great job, more PRs like this are welcome. Thanks for taking the extra mile as of the code reviews.
If video contains for example man and woman faces and I wanna to replace woman's only is it possible for now?