          """ 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)
              foreground *= mask
              background *= (1.0 - mask)
 
</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     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)
 </s> add     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) </s> remove         np.clip(new_face, 0.0, 1.0, out=new_face)
 </s> add  </s> remove         patched_face = np.rint(
            patched_face,
            out=np.empty(patched_face.shape, dtype="uint8"),
            casting='unsafe'
        )
        if self.writer_pre_encode is not None:
            patched_face = self.writer_pre_encode(patched_face)
 </s> add         patched_face = np.rint(patched_face,
                               out=np.empty(patched_face.shape, dtype="uint8"),
                               casting='unsafe')
        if self._writer_pre_encode is not None:
            patched_face = self._writer_pre_encode(patched_face) </s> remove         new_image, background = self.get_new_image(predicted, frame_size)
        patched_face = self.post_warp_adjustments(background, new_image)
        patched_face = self.scale_image(patched_face)
 </s> add         new_image, background = self._get_new_image(predicted, frame_size)
        patched_face = self._post_warp_adjustments(background, new_image)
        patched_face = self._scale_image(patched_face)
        if self._draw_transparent:
          """ 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)
              foreground *= mask
              background *= (1.0 - mask)
keep keep keep keep 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