                       predicted["filename"], placeholder.shape)
  
          return placeholder, background
  
      def pre_warp_adjustments(self, old_face, new_face, detected_face, predicted_mask):
          """ Run the pre-warp adjustments """
          logger.trace("old_face shape: %s, new_face shape: %s, predicted_mask shape: %s",
                       old_face.shape, new_face.shape,
                       predicted_mask.shape if predicted_mask is not None else None)
          new_face = self.adjustments["box"].run(new_face)
          new_face, raw_mask = self.get_image_mask(new_face, detected_face, predicted_mask)
          if self.adjustments["color"] is not None:
              new_face = self.adjustments["color"].run(old_face, new_face, raw_mask)
 
</s> remove         new_face = self.adjustments["box"].run(new_face)
        new_face, raw_mask = self.get_image_mask(new_face, detected_face, predicted_mask)
        if self.adjustments["color"] is not None:
            new_face = self.adjustments["color"].run(old_face, new_face, raw_mask)
        if self.adjustments["seamless"] is not None:
            new_face = self.adjustments["seamless"].run(old_face, new_face, raw_mask)
 </s> add         old_face = detected_face.reference_face[..., :3] / 255.0
        new_face = self._adjustments["box"].run(new_face)
        new_face, raw_mask = self._get_image_mask(new_face, detected_face, predicted_mask)
        if self._adjustments["color"] is not None:
            new_face = self._adjustments["color"].run(old_face, new_face, raw_mask)
        if self._adjustments["seamless"] is not None:
            new_face = self._adjustments["seamless"].run(old_face, new_face, raw_mask) </s> remove             src_face = detected_face.reference_face[..., :3] / 255.0
 </s> add  </s> remove             new_face = self.pre_warp_adjustments(src_face, new_face, detected_face, predicted_mask)
 </s> add             new_face = self._pre_warp_adjustments(new_face, detected_face, predicted_mask) </s> remove     def get_image_mask(self, new_face, detected_face, predicted_mask):
        """ Get the image mask """
 </s> add     def _get_image_mask(self, new_face, detected_face, predicted_mask):
        """ Return any selected image mask and intersect with any box mask.

        Places the requested mask into the new face's Alpha channel, intersecting with any box
        mask that has already been applied.

        Parameters
        ----------
        new_face: :class:`numpy.ndarray`
            The swapped face received from the faceswap model, with any box mask applied
        detected_face: :class:`~lib.faces_detect.DetectedFace`
            The detected_face object as defined in :class:`scripts.convert.Predictor`
        predicted_mask: :class:`numpy.ndarray` or ``None``
            The predicted mask output from the Faceswap model. ``None`` if the model
            did not learn a mask

        Returns
        :class:`numpy.ndarray`
            The swapped face with the requested mask added to the Alpha channel
        """ </s> remove             cv2.warpAffine(  # pylint: disable=no-member
                new_face,
                detected_face.reference_matrix,
                frame_size,
                placeholder,
                flags=cv2.WARP_INVERSE_MAP | interpolator,  # pylint: disable=no-member
                borderMode=cv2.BORDER_TRANSPARENT)  # pylint: disable=no-member
 </s> add             cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
    def _pre_warp_adjustments(self, new_face, detected_face, predicted_mask):
        """ Run any requested adjustments that can be performed on the raw output from the Faceswap
        model.

        Any adjustments that can be performed before warping the face into the final frame are
        performed here.

        Parameters
        ----------
        new_face: :class:`numpy.ndarray`
            The swapped face received from the faceswap model.
        detected_face: :class:`~lib.faces_detect.DetectedFace`
            The detected_face object as defined in :class:`scripts.convert.Predictor`
        predicted_mask: :class:`numpy.ndarray` or ``None``
            The predicted mask output from the Faceswap model. ``None`` if the model
            did not learn a mask

        Returns
        -------
        :class:`numpy.ndarray`
            The face output from the Faceswap Model with any requested pre-warp adjustments
            performed.
        """
        logger.trace("new_face shape: %s, predicted_mask shape: %s", new_face.shape,
                       predicted["filename"], placeholder.shape)
  
          return placeholder, background
  
    def _pre_warp_adjustments(self, new_face, detected_face, predicted_mask):
        """ Run any requested adjustments that can be performed on the raw output from the Faceswap
        model.

        Any adjustments that can be performed before warping the face into the final frame are
        performed here.

        Parameters
        ----------
        new_face: :class:`numpy.ndarray`
            The swapped face received from the faceswap model.
        detected_face: :class:`~lib.faces_detect.DetectedFace`
            The detected_face object as defined in :class:`scripts.convert.Predictor`
        predicted_mask: :class:`numpy.ndarray` or ``None``
            The predicted mask output from the Faceswap model. ``None`` if the model
            did not learn a mask

        Returns
        -------
        :class:`numpy.ndarray`
            The face output from the Faceswap Model with any requested pre-warp adjustments
            performed.
        """
        logger.trace("new_face shape: %s, predicted_mask shape: %s", new_face.shape,
    def _pre_warp_adjustments(self, new_face, detected_face, predicted_mask):
        """ Run any requested adjustments that can be performed on the raw output from the Faceswap
        model.

        Any adjustments that can be performed before warping the face into the final frame are
        performed here.

        Parameters
        ----------
        new_face: :class:`numpy.ndarray`
            The swapped face received from the faceswap model.
        detected_face: :class:`~lib.faces_detect.DetectedFace`
            The detected_face object as defined in :class:`scripts.convert.Predictor`
        predicted_mask: :class:`numpy.ndarray` or ``None``
            The predicted mask output from the Faceswap model. ``None`` if the model
            did not learn a mask

        Returns
        -------
        :class:`numpy.ndarray`
            The face output from the Faceswap Model with any requested pre-warp adjustments
            performed.
        """
        logger.trace("new_face shape: %s, predicted_mask shape: %s", new_face.shape,
    def _pre_warp_adjustments(self, new_face, detected_face, predicted_mask):
        """ Run any requested adjustments that can be performed on the raw output from the Faceswap
        model.

        Any adjustments that can be performed before warping the face into the final frame are
        performed here.

        Parameters
        ----------
        new_face: :class:`numpy.ndarray`
            The swapped face received from the faceswap model.
        detected_face: :class:`~lib.faces_detect.DetectedFace`
            The detected_face object as defined in :class:`scripts.convert.Predictor`
        predicted_mask: :class:`numpy.ndarray` or ``None``
            The predicted mask output from the Faceswap model. ``None`` if the model
            did not learn a mask

        Returns
        -------
        :class:`numpy.ndarray`
            The face output from the Faceswap Model with any requested pre-warp adjustments
            performed.
        """
        logger.trace("new_face shape: %s, predicted_mask shape: %s", new_face.shape,
    def _pre_warp_adjustments(self, new_face, detected_face, predicted_mask):
        """ Run any requested adjustments that can be performed on the raw output from the Faceswap
        model.

        Any adjustments that can be performed before warping the face into the final frame are
        performed here.

        Parameters
        ----------
        new_face: :class:`numpy.ndarray`
            The swapped face received from the faceswap model.
        detected_face: :class:`~lib.faces_detect.DetectedFace`
            The detected_face object as defined in :class:`scripts.convert.Predictor`
        predicted_mask: :class:`numpy.ndarray` or ``None``
            The predicted mask output from the Faceswap model. ``None`` if the model
            did not learn a mask

        Returns
        -------
        :class:`numpy.ndarray`
            The face output from the Faceswap Model with any requested pre-warp adjustments
            performed.
        """
        logger.trace("new_face shape: %s, predicted_mask shape: %s", new_face.shape,
                       predicted_mask.shape if predicted_mask is not None else None)
          new_face = self.adjustments["box"].run(new_face)
          new_face, raw_mask = self.get_image_mask(new_face, detected_face, predicted_mask)
          if self.adjustments["color"] is not None:
              new_face = self.adjustments["color"].run(old_face, new_face, raw_mask)
keep keep keep keep 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