  
              new_face = self.pre_warp_adjustments(src_face, new_face, detected_face, predicted_mask)
  
              # Warp face with the mask
              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
  
          np.clip(placeholder, 0.0, 1.0, out=placeholder)
          logger.trace("Got filename: '%s'. (placeholders: %s)",
                       predicted["filename"], placeholder.shape)
  
 
</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             src_face = detected_face.reference_face[..., :3] / 255.0
 </s> add  </s> remove             mask = cv2.dilate(mask, kernel, iterations=1)  # pylint: disable=no-member
 </s> add             mask = cv2.dilate(mask, kernel, iterations=1) </s> remove             mask = cv2.erode(mask, kernel, iterations=1)  # pylint: disable=no-member
 </s> add             mask = cv2.erode(mask, kernel, iterations=1) </s> remove     def get_erosion_kernel(self, mask):
        """ Get the erosion kernel """
 </s> add     def _get_erosion_kernel(self, mask):
        """ Get the erosion kernel.

        Parameters
        ----------
        mask: :class:`numpy.ndarray`
            The mask to be eroded or dilated

        Returns
        -------
        :class:`numpy.ndarray`
            The erosion kernel to be used for erosion/dilation
        """
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
  
              new_face = self.pre_warp_adjustments(src_face, new_face, detected_face, predicted_mask)
  
              # Warp face with the mask
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
            cv2.warpAffine(new_face,
                           detected_face.reference_matrix,
                           frame_size,
                           placeholder,
                           flags=cv2.WARP_INVERSE_MAP | interpolator,
                           borderMode=cv2.BORDER_TRANSPARENT)
  
          np.clip(placeholder, 0.0, 1.0, out=placeholder)
          logger.trace("Got filename: '%s'. (placeholders: %s)",
                       predicted["filename"], placeholder.shape)
  
keep keep keep keep 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