MaskGenerator

class tools.mask.mask_generate.MaskGenerator(mask_type: str, update_all: bool, input_is_faces: bool, loader: loader.Loader, alignments: align.alignments.Alignments | None, input_location: str, config_file: str | None)

Bases: object

Uses faceswap’s extract pipeline to generate masks and update them into the alignments file and/or extracted face PNG Headers

Parameters:
  • mask_type (str) – The mask type to generate

  • update_all (bool) – True to update all faces, False to only update faces missing masks

  • input_is_faces (bool) – True if the input are faceswap extracted faces otherwise False

  • loader (loader.Loader) – The loader for loading source images/video from disk

  • config_file (str | None) – Full path to a custom config file to load. None for default config

  • alignments (align.alignments.Alignments | None)

  • input_location (str)

Methods Summary

process()

Process the output from the extractor pipeline

Methods Documentation

process() T.Generator[FrameFaces, None, None]

Process the output from the extractor pipeline

Yields:

The FrameFaces object with updated masks

Return type:

T.Generator[FrameFaces, None, None]

process() T.Generator[FrameFaces, None, None]

Process the output from the extractor pipeline

Yields:

The FrameFaces object with updated masks

Return type:

T.Generator[FrameFaces, None, None]