  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
  
  class Converter():
      """ Swap a source face with a target """
      def __init__(self, output_dir, output_size, output_has_mask,
                   draw_transparent, pre_encode, arguments, configfile=None):
          logger.debug("Initializing %s: (output_dir: '%s', output_size: %s,  output_has_mask: %s, "
                       "draw_transparent: %s, pre_encode: %s, arguments: %s, configfile: %s)",
                       self.__class__.__name__, output_dir, output_size, output_has_mask,
                       draw_transparent, pre_encode, arguments, configfile)
          self.output_dir = output_dir
          self.draw_transparent = draw_transparent
          self.writer_pre_encode = pre_encode
          self.scale = arguments.output_scale / 100
          self.output_size = output_size
          self.output_has_mask = output_has_mask
          self.args = arguments
          self.configfile = configfile
          self.adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)
          self.load_plugins()
          logger.debug("Initialized %s", self.__class__.__name__)
  
      def reinitialize(self, config):
          """ reinitialize converter """
          logger.debug("Reinitializing converter")
 
</s> remove         self.adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)
        self.load_plugins(config=config, disable_logging=True)
 </s> add         self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)
        self._load_plugins(config=config, disable_logging=True) </s> remove                      "predicted_available: %s, configfile: %s, config: %s)",
                     self.__class__.__name__, mask_type, output_size, predicted_available,
                     configfile, config)
        self.config = self.set_config(configfile, config)
 </s> add                      "configfile: %s, config: %s)", self.__class__.__name__, mask_type,
                     output_size, configfile, config)
        self.config = self._set_config(configfile, config) </s> remove         """ reinitialize converter """
 </s> add         """ Reinitialize this :class:`Converter`.

        Called as part of the :mod:`~tools.preview` tool. Resets all adjustments then loads the
        plugins as specified in the given config.

        Parameters
        ----------
        config: :class:`lib.config.FaceswapConfig`
            Pre-loaded :class:`lib.config.FaceswapConfig`. used over any configuration on disk.
        """ </s> remove         self.args = arguments
        self.is_extract = is_extract
        folder, filename = self.set_folder_filename(input_is_video)
        super().__init__(folder,
                         filename=filename)
 </s> add         self._args = arguments
        self._is_extract = is_extract
        folder, filename = self._set_folder_filename(input_is_video)
        super().__init__(folder, filename=filename) </s> remove         self.samples = samples
        self.queue_patch_in = queue_manager.get_queue("preview_patch_in")
        self.display = display
        self.lock = lock
        self.trigger = trigger
 </s> add         self._samples = samples
        self._queue_patch_in = queue_manager.get_queue("preview_patch_in")
        self._display = display
        self._lock = lock
        self._trigger = trigger
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
  
  class Converter():
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
    """ The converter is responsible for swapping the original face(s) in a frame with the output
    of a trained Faceswap model.

    Parameters
    ----------
    output_size: int
        The size of the face, in pixels, that is output from the Faceswap model
    coverage_ratio: float
        The ratio of the training image that was used for training the Faceswap model
    draw_transparent: bool
        Whether the final output should be drawn onto a transparent layer rather than the original
        frame. Only available with certain writer plugins.
    pre_encode: python function
        Some writer plugins support the pre-encoding of images prior to saving out. As patching is
        done in multiple threads, but writing is done in a single thread, it can speed up the
        process to do any pre-encoding as part of the converter process.
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the convert process as generated from Faceswap's command
        line arguments
    configfile: str, optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    """
    def __init__(self, output_size, coverage_ratio, draw_transparent, pre_encode,
                 arguments, configfile=None):
        logger.debug("Initializing %s: (output_size: %s,  coverage_ratio: %s, draw_transparent: "
                     "%s, pre_encode: %s, arguments: %s, configfile: %s)", self.__class__.__name__,
                     output_size, coverage_ratio, draw_transparent, pre_encode, arguments,
                     configfile)
        self._output_size = output_size
        self._coverage_ratio = coverage_ratio
        self._draw_transparent = draw_transparent
        self._writer_pre_encode = pre_encode
        self._args = arguments
        self._configfile = configfile

        self._scale = arguments.output_scale / 100
        self._adjustments = dict(box=None, mask=None, color=None, seamless=None, scaling=None)

        self._load_plugins()
          logger.debug("Initialized %s", self.__class__.__name__)
  
      def reinitialize(self, config):
          """ reinitialize converter """
          logger.debug("Reinitializing converter")
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Smart Masks to Convert (#957)

- scripts.convert - Use Smart Masks for Convert
    * Make on-the-fly conversion an explicit option

- Move BlurMask to lib.faces_detect

- tools.preview - Fix for smart masks
    * Subclass from tk.Tk
    * Options to lib.gui.control_helper
    *variable cleanup

- lib.logger - Demote more tensorflow deprecation messages

- Documentation:
    * lib.faces_detect.BlurMask
    * plugins.convert.mask
    * lib.convert
    * scripts.convert
    * scripts.fsmedia
    * tools.preview 
lib/convert.py