tools package

The Tools Package provides various tools for working with Faceswap outside of the core functionality.

Subpackages

mask module

Tool to generate masks and previews of masks for existing alignments file

class tools.mask.mask.Mask(arguments: Namespace)

Bases: object

This tool is part of the Faceswap Tools suite and should be called from python tools.py mask command.

Faceswap Masks tool. Generate masks from existing alignments files, and output masks for preview.

Wrapper for the mask process to run in either batch mode or single use mode

Parameters:

arguments (argparse.Namespace) – The argparse arguments as passed in from tools.py

process() None

The entry point for triggering the Extraction Process.

Should only be called from lib.cli.launcher.ScriptExecutor

model module

Tool to restore models from backup

class tools.model.model.Inference(arguments: argparse.Namespace)

Bases: object

Save an inference model from a trained Faceswap model.

:param argparse.Namespace: The command line arguments calling the model tool

process() None

Run the inference model creation process.

class tools.model.model.Model(arguments: argparse.Namespace)

Bases: object

Tool to perform actions on a model file.

:param argparse.Namespace: The command line arguments calling the model tool

process() None

Call the selected model job.

class tools.model.model.NaNScan(arguments: argparse.Namespace)

Bases: object

Tool to scan for NaN and Infs in model weights.

:param argparse.Namespace: The command line arguments calling the model tool

process() None

Scan the loaded model for NaNs and Infs and output summary.

class tools.model.model.Restore(arguments: argparse.Namespace)

Bases: object

Restore a model from backup.

:param argparse.Namespace: The command line arguments calling the model tool

process() None

Perform the Restore process