deepfakes / faceswap

Deepfakes Software For All
https://www.faceswap.dev
GNU General Public License v3.0
49.94k stars 13.01k forks source link

Add Mask importing to the mask tool #1376

Closed torzdf closed 4 months ago

torzdf commented 4 months ago

This PR adds the ability to import masks into faceswap alignment files/PNG Headers for extracted faces.

Masks can be imported/exported as either the stored 'face-aligned' mask, or as a full-frame mask for the entire frame/image

Export masks

Masks can be exported from faceswap for editing in external tools. They will be output as either aligned face masks, or as full frame masks, depending on what type of input (frames or faces) that you feed the mask tool, and which works best for your workflow.

Exported masks will be placed in the output folder as single channel (grayscale) images, and will be named correctly for importing (after editing)

Import masks

Masks can be imported, after editing/creation in external tools. Masks can be created in most image formats, but will ultimately be stored internally as single-channel 8-bit grayscale images.

Note: batch-mode is not supported for mask import