FaceSwapArgs

class lib.cli.args.FaceSwapArgs(subparser: _SubParsersAction | None, command: str, description: str = 'default')

Bases: object

Faceswap argument parser functions that are universal to all commands.

This is the parent class to all subsequent argparsers which holds global arguments that pertain to all commands.

Process the incoming command line arguments, validates then launches the relevant faceswap script with the given arguments.

Parameters:
  • subparser (argparse._SubParsersAction | None) – The subparser for the given command. None if the class is being called for reading rather than processing

  • command (str) – The faceswap command that is to be executed

  • description (str, optional) – The description for the given command. Default: “default”

Methods Summary

get_argument_list()

Returns the argument list for the current command.

get_info()

Returns the information text for the current command.

get_optional_arguments()

Returns the optional argument list for the current command.

Methods Documentation

static get_argument_list() list[dict[str, Any]]

Returns the argument list for the current command.

The argument list should be a list of dictionaries pertaining to each option for a command. This function should be overridden with the actual argument list for each command’s argument list.

See existing parsers for examples.

Returns:

The list of command line options for the given command

Return type:

list

static get_info() str

Returns the information text for the current command.

This function should be overridden with the actual command help text for each commands’ parser.

Returns:

The information text for this command.

Return type:

str

static get_optional_arguments() list[dict[str, Any]]

Returns the optional argument list for the current command.

The optional arguments list is not always required, but is used when there are shared options between multiple commands (e.g. convert and extract). Only override if required.

Returns:

The list of optional command line options for the given command

Return type:

list

static get_argument_list() list[dict[str, Any]]

Returns the argument list for the current command.

The argument list should be a list of dictionaries pertaining to each option for a command. This function should be overridden with the actual argument list for each command’s argument list.

See existing parsers for examples.

Returns:

The list of command line options for the given command

Return type:

list

static get_info() str

Returns the information text for the current command.

This function should be overridden with the actual command help text for each commands’ parser.

Returns:

The information text for this command.

Return type:

str

static get_optional_arguments() list[dict[str, Any]]

Returns the optional argument list for the current command.

The optional arguments list is not always required, but is used when there are shared options between multiple commands (e.g. convert and extract). Only override if required.

Returns:

The list of optional command line options for the given command

Return type:

list