Page 1 of 1

Masking not working? Questions about masks (newbie)

Posted: Sat Feb 06, 2021 9:04 am
by Absimiliard

I just started dabbling with Faceswap this week. I have been playing with some different configurations, trying to get the swing of things. I hadn't generated any asks on the fist few projects and decided that they would help. I was able to generate a mask (Vgg-Obstructed) with the Mask Tool and was a little confused. In the output options I can choose between Combines, Masked and Mask. The Masked option says the output will be an "rgba image with the face masked". When I generated the mask png files with transparency were generated into the output folder specified.

I figured at this point that I should have generated these at the beginning so, on my next extraction, I selected Vgg-Obstructed as the Masker. During extraction I noticed that a there was a third pass for mask generation (as expected) but, upon completion, noticed that the output folder seemed to contain png files without transparency. I thought maybe the masked files were p[laced elsewhere but couldn't locate them so I assumed that maybe the alignment file was somehow containing the mask data. Upon training I noticed that areas that should have been masked were bleeding into the faces and guessed that the masks hadn't generated properly. I wasn't sure what went wrong so I saved the project and started a new one thinking that might resolve the issue. It did not as far as I can tell. Am I missing something?


Re: Masking not working? Questions about masks (newbie)

Posted: Sat Feb 06, 2021 7:15 pm
by torzdf

No, you're doing nothing wrong.

The masks are not stored in the output images, but in the alignments file. This is because you can have multiple masks (and 2 are generated by default).

The easiest way to view them is with the manual tool. The "Output" option in the mask tool is just a mechanism for viewing the mask applied to a face. It serves no functional purpose within faceswap.

My personal preference is to not generate any extra masks during extraction, but generate them after I've cleaned up my alignments file. The reason for this is that when you change any landmarks (i.e. in the manual tool) the originally extracted masks are no longer valid, as the face image will have changed when you updated any alignments.


Re: Masking not working? Questions about masks (newbie)

Posted: Mon Feb 08, 2021 1:56 am
by Absimiliard

Thanks very much for your reply. I've got that part figured now. I se that the mask tool can read or assign masks to an alignment file. I do have another mask question though...

How are the masks combined? By this I mean are they additive? If so then If I generate a mask with holes to exclude obstructions to the face isn't the effort removed when that mask is added to the component and extended mask during training or conversion as they will not have those exclusions?

Oops... nevermind I think I figured this out as well. It seems you can select the mask to be used in the Train settings. This would explain the issues I've been having