              blurring. Should be odd, if an even number is passed in (outside of 0) then it is
              rounded up to the next odd number. Default: 0
          threshold: int, optional
              The threshold amount to minimize/maximize mask values to 0 and 100. Percentage value.
              Default: 0
          """
          logger.trace("blur_kernel: %s, threshold: %s", blur_kernel, threshold)
 
</s> remove         if blur_kernel == 0 or blur_kernel % 2 == 1:
            self._blur_kernel = blur_kernel
        else:
            self._blur_kernel = blur_kernel + 1
 </s> add         if blur_type is not None:
            blur_kernel += 0 if blur_kernel == 0 or blur_kernel % 2 == 1 else 1
            self._blur["kernel"] = blur_kernel
            self._blur["type"] = blur_type
            self._blur["passes"] = blur_passes </s> remove     "radius": {
        "default": 3.0,
        "info": "Radius dictates how much blending should occur.\nThis figure is set as a "
                "percentage of the mask diameter to give the radius in pixels. Eg: for a mask "
                "with diameter 200px, a percentage of 6% would give a final radius of 3px.\n"
                "Higher percentage means more blending.",
        "datatype": float,
 </s> add     "kernel_size": {
        "default": 3,
        "info": "The kernel size dictates how much blending should occur.\n"
                "The size is the diameter of the kernel in pixels (calculated from a 128px mask). "
                " This value should be odd, if an even number is passed in then it will be "
                "rounded to the next odd number. Higher sizes means more blending.",
        "datatype": int, </s> remove     """ Return the requested mask """
    def __init__(self, mask_type, output_size, predicted_available, **kwargs):
        super().__init__(mask_type, output_size, predicted_available, **kwargs)
        self.do_erode = self.config.get("erosion", 0) != 0
        self.do_blend = self.config.get("type", None) is not None

    def process(self, detected_face, predicted_mask=None):
        """ Return mask and perform processing """
        mask = self.get_mask(detected_face, predicted_mask)
 </s> add     """ Manipulations to perform to the mask that is to be applied to the output of the Faceswap
    model.

    Parameters
    ----------
    mask_type: str
        The mask type to use for this plugin
    output_size: int
        The size of the output from the Faceswap model.
    coverage_ratio: float
        The coverage ratio that the Faceswap model was trained at.
    **kwargs: dict, optional
        See the parent :class:`~plugins.convert.mask._base` for additional keyword arguments.
    """
    def __init__(self, mask_type, output_size, coverage_ratio, **kwargs):
        super().__init__(mask_type, output_size, **kwargs)
        self._do_erode = self.config.get("erosion", 0) != 0
        self._coverage_ratio = coverage_ratio

    def process(self, detected_face, predicted_mask=None):  # pylint:disable=arguments-differ
        """ Obtain the requested mask type and perform any defined mask manipulations.

        Parameters
        ----------
        detected_face: :class:`lib.faces_detect.DetectedFace`
            The DetectedFace object as returned from :class:`scripts.convert.Predictor`.
        predicted_mask: :class:`numpy.ndarray`, optional
            The predicted mask as output from the Faceswap Model, if the model was trained
            with a mask, otherwise ``None``. Default: ``None``.

        Returns
        -------
        mask: :class:`numpy.ndarray`
            The mask with all requested manipulations applied
        raw_mask: :class:`numpy.ndarray`
            The mask with no erosion/dilation applied
        """
        mask = self._get_mask(detected_face, predicted_mask) </s> remove     def load_plugins(self, config=None, disable_logging=False):
        """ Load the requested adjustment plugins """
 </s> add     def _load_plugins(self, config=None, disable_logging=False):
        """ Load the requested adjustment plugins.

        Loads the :mod:`plugins.converter` plugins that have been requested for this conversion
        session.

        Parameters
        ----------
        config: :class:`lib.config.FaceswapConfig`, optional
            Optional pre-loaded :class:`lib.config.FaceswapConfig`. If passed, then this will be
            used over any configuration on disk. If ``None`` then it is ignored. Default: ``None``
        disable_logging: bool, optional
            Plugin loader outputs logging info every time a plugin is loaded. Set to ``True`` to
            suppress these messages otherwise ``False``. Default: ``False``
        """ </s> remove     """ Parent class for adjustments """
    def __init__(self, mask_type, output_size, predicted_available, configfile=None, config=None):
 </s> add     """ Parent class for Mask Adjustment Plugins.

    All mask plugins must inherit from this class.

    Parameters
    ----------
    mask_type: str
        The type of mask that this plugin is being used for
    output_size: int
        The size, in pixels, of the output from the Faceswap model.
    configfile: str, Optional
        Optional location of custom configuration ``ini`` file. If ``None`` then use the default
        config location. Default: ``None``
    config: :class:`lib.config.FaceswapConfig`, Optional
        Optional pre-loaded :class:`lib.config.FaceswapConfig`. If passed, then this will be used
        over any configuration on disk. If ``None`` then it is ignored. Default: ``None``


    Attributes
    ----------
    config: dict
        The configuration dictionary for this plugin.
    mask_type: str
        The type of mask that this plugin is being used for.
    """
    def __init__(self, mask_type, output_size, configfile=None, config=None):
        blur_type: ["gaussian", "normalized"], optional
            The blur type to use. ``gaussian`` or ``normalized`` box filter. Default: ``gaussian``
        blur_passes: int, optional
            The number of passed to perform when blurring. Default: 1
              blurring. Should be odd, if an even number is passed in (outside of 0) then it is
              rounded up to the next odd number. Default: 0
        blur_type: ["gaussian", "normalized"], optional
            The blur type to use. ``gaussian`` or ``normalized`` box filter. Default: ``gaussian``
        blur_passes: int, optional
            The number of passed to perform when blurring. Default: 1
          threshold: int, optional
              The threshold amount to minimize/maximize mask values to 0 and 100. Percentage value.
              Default: 0
          """
          logger.trace("blur_kernel: %s, threshold: %s", blur_kernel, threshold)
keep add 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/faces_detect.py