          np.clip(new_face, 0.0, 1.0, out=new_face)
          logger.trace("Got mask. Image shape: %s", new_face.shape)
          return new_face, raw_mask
  
      def post_warp_adjustments(self, background, new_image):
          """ Apply fixes to the image after warping """
          if self.adjustments["scaling"] is not None:
              new_image = self.adjustments["scaling"].run(new_image)
  
          if self.draw_transparent:
              frame = new_image
          else:
              foreground, mask = np.split(new_image, (3, ), axis=-1)
 
</s> remove         np.clip(new_face, 0.0, 1.0, out=new_face)
 </s> add  </s> remove         if self.draw_transparent:
 </s> add         if self._draw_transparent: </s> remove             foreground, mask = np.split(new_image, (3, ), axis=-1)
 </s> add             foreground, mask = np.split(new_image,  # pylint:disable=unbalanced-tuple-unpacking
                                        (3, ),
                                        axis=-1) </s> remove         mask, raw_mask = self.adjustments["mask"].run(detected_face, predicted_mask)
 </s> add         mask, raw_mask = self._adjustments["mask"].run(detected_face, predicted_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)
    def _post_warp_adjustments(self, background, new_image):
        """ Perform any requested adjustments to the swapped faces after they have been transformed
        into the final frame.

        Parameters
        ----------
        background: :class:`numpy.ndarray`
            The original frame
        new_image: :class:`numpy.ndarray`
            A blank frame of original frame size with the faces warped onto it

        Returns
        -------
        :class:`numpy.ndarray`
            The final merged and swapped frame with any requested post-warp adjustments applied
        """
        if self._adjustments["scaling"] is not None:
            new_image = self._adjustments["scaling"].run(new_image)
          np.clip(new_face, 0.0, 1.0, out=new_face)
          logger.trace("Got mask. Image shape: %s", new_face.shape)
          return new_face, raw_mask
  
    def _post_warp_adjustments(self, background, new_image):
        """ Perform any requested adjustments to the swapped faces after they have been transformed
        into the final frame.

        Parameters
        ----------
        background: :class:`numpy.ndarray`
            The original frame
        new_image: :class:`numpy.ndarray`
            A blank frame of original frame size with the faces warped onto it

        Returns
        -------
        :class:`numpy.ndarray`
            The final merged and swapped frame with any requested post-warp adjustments applied
        """
        if self._adjustments["scaling"] is not None:
            new_image = self._adjustments["scaling"].run(new_image)
    def _post_warp_adjustments(self, background, new_image):
        """ Perform any requested adjustments to the swapped faces after they have been transformed
        into the final frame.

        Parameters
        ----------
        background: :class:`numpy.ndarray`
            The original frame
        new_image: :class:`numpy.ndarray`
            A blank frame of original frame size with the faces warped onto it

        Returns
        -------
        :class:`numpy.ndarray`
            The final merged and swapped frame with any requested post-warp adjustments applied
        """
        if self._adjustments["scaling"] is not None:
            new_image = self._adjustments["scaling"].run(new_image)
    def _post_warp_adjustments(self, background, new_image):
        """ Perform any requested adjustments to the swapped faces after they have been transformed
        into the final frame.

        Parameters
        ----------
        background: :class:`numpy.ndarray`
            The original frame
        new_image: :class:`numpy.ndarray`
            A blank frame of original frame size with the faces warped onto it

        Returns
        -------
        :class:`numpy.ndarray`
            The final merged and swapped frame with any requested post-warp adjustments applied
        """
        if self._adjustments["scaling"] is not None:
            new_image = self._adjustments["scaling"].run(new_image)
    def _post_warp_adjustments(self, background, new_image):
        """ Perform any requested adjustments to the swapped faces after they have been transformed
        into the final frame.

        Parameters
        ----------
        background: :class:`numpy.ndarray`
            The original frame
        new_image: :class:`numpy.ndarray`
            A blank frame of original frame size with the faces warped onto it

        Returns
        -------
        :class:`numpy.ndarray`
            The final merged and swapped frame with any requested post-warp adjustments applied
        """
        if self._adjustments["scaling"] is not None:
            new_image = self._adjustments["scaling"].run(new_image)
  
          if self.draw_transparent:
              frame = new_image
          else:
              foreground, mask = np.split(new_image, (3, ), axis=-1)
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