          self.tk_image = ImageTk.PhotoImage(img)
          self.tk_vars["refresh"].set(False)
          logger.trace("Updated tk image")
  
      def get_scale_size(self, image):
          """ Return the scale and size for passed in display image """
          frameratio = float(self.display_dims[0]) / float(self.display_dims[1])
          imgratio = float(image.shape[1]) / float(image.shape[0])
  
          if frameratio <= imgratio:
              scale = self.display_dims[0] / float(image.shape[1])
              size = (self.display_dims[0], max(1, int(image.shape[0] * scale)))
 
</s> remove             scale = self.display_dims[0] / float(image.shape[1])
            size = (self.display_dims[0], max(1, int(image.shape[0] * scale)))
 </s> add             scale = self._display_dims[0] / float(image.shape[1])
            size = (self._display_dims[0], max(1, int(image.shape[0] * scale))) </s> remove         self.tk_image = ImageTk.PhotoImage(img)
        self.tk_vars["refresh"].set(False)
 </s> add         self._tk_image = ImageTk.PhotoImage(img)
        self._tk_vars["refresh"].set(False) </s> remove             scale = self.display_dims[1] / float(image.shape[0])
            size = (max(1, int(image.shape[1] * scale)), self.display_dims[1])
 </s> add             scale = self._display_dims[1] / float(image.shape[0])
            size = (max(1, int(image.shape[1] * scale)), self._display_dims[1]) </s> remove         self.build_faces_image()
        img = np.vstack((self.faces_source, self.faces_dest))
        size = self.get_scale_size(img)
 </s> add         self._build_faces_image()
        img = np.vstack((self._faces_source, self._faces_dest))
        size = self._get_scale_size(img) </s> remove     def scale_image(self, frame):
        """ Scale the image if requested """
        if self.scale == 1:
 </s> add     def _scale_image(self, frame):
        """ Scale the final image if requested.

        If output scale has been requested in command line arguments, scale the output
        otherwise return the final frame.

        Parameters
        ----------
        frame: :class:`numpy.ndarray`
            The final frame with faces swapped

        Returns
        -------
        :class:`numpy.ndarray`
            The final frame scaled by the requested scaling factor
        """
        if self._scale == 1:
    def _get_scale_size(self, image):
        """ Get the size that the full preview image should be resized to fit in the
        display window.

        Parameters
        ----------
        image: :class:`numpy.ndarray`
            The full sized compiled preview image

        Returns
        -------
        tuple
            The (`width`, `height`) that the display image should be sized to fit in the display
            window
        """
        frameratio = float(self._display_dims[0]) / float(self._display_dims[1])
          self.tk_image = ImageTk.PhotoImage(img)
          self.tk_vars["refresh"].set(False)
          logger.trace("Updated tk image")
  
    def _get_scale_size(self, image):
        """ Get the size that the full preview image should be resized to fit in the
        display window.

        Parameters
        ----------
        image: :class:`numpy.ndarray`
            The full sized compiled preview image

        Returns
        -------
        tuple
            The (`width`, `height`) that the display image should be sized to fit in the display
            window
        """
        frameratio = float(self._display_dims[0]) / float(self._display_dims[1])
    def _get_scale_size(self, image):
        """ Get the size that the full preview image should be resized to fit in the
        display window.

        Parameters
        ----------
        image: :class:`numpy.ndarray`
            The full sized compiled preview image

        Returns
        -------
        tuple
            The (`width`, `height`) that the display image should be sized to fit in the display
            window
        """
        frameratio = float(self._display_dims[0]) / float(self._display_dims[1])
    def _get_scale_size(self, image):
        """ Get the size that the full preview image should be resized to fit in the
        display window.

        Parameters
        ----------
        image: :class:`numpy.ndarray`
            The full sized compiled preview image

        Returns
        -------
        tuple
            The (`width`, `height`) that the display image should be sized to fit in the display
            window
        """
        frameratio = float(self._display_dims[0]) / float(self._display_dims[1])
          imgratio = float(image.shape[1]) / float(image.shape[0])
  
          if frameratio <= imgratio:
              scale = self.display_dims[0] / float(image.shape[1])
              size = (self.display_dims[0], max(1, int(image.shape[0] * scale)))
keep keep keep keep 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 
tools/preview.py