          """ Load the model requested for conversion """
          logger.debug("Loading Model")
          model_dir = get_folder(self.args.model_dir, make_folder=False)
          if not model_dir:
              raise FaceswapError("{} does not exist.".format(self.args.model_dir))
          trainer = self.get_trainer(model_dir)
          gpus = 1 if not hasattr(self.args, "gpus") else self.args.gpus
          model = PluginLoader.get_model(trainer)(model_dir, gpus, predict=True)
          logger.debug("Loaded Model")
          return model
  
      def get_trainer(self, model_dir):
 
</s> remove         model_dir = get_folder(self.args.model_dir, make_folder=False)
 </s> add         model_dir = get_folder(self._args.model_dir, make_folder=False) </s> remove     def load_model(self):
        """ Load the model requested for conversion """
 </s> add     def _load_model(self):
        """ Load the Faceswap model.

        Returns
        -------
        :mod:`plugins.train.model` plugin
            The trained model in the specified model folder
        """ </s> remove     def get_trainer(self, model_dir):
        """ Return the trainer name if provided, or read from state file """
        if hasattr(self.args, "trainer") and self.args.trainer:
            logger.debug("Trainer name provided: '%s'", self.args.trainer)
            return self.args.trainer
 </s> add     def _get_model_name(self, model_dir):
        """ Return the name of the Faceswap model used.

        If a "trainer" option has been selected in the command line arguments, use that value,
        otherwise retrieve the name of the model from the model's state file.

        Parameters
        ----------
        model_dir: str
            The folder that contains the trained Faceswap model

        Returns
        -------
        str
            The name of the Faceswap model being used.

        """
        if hasattr(self._args, "trainer") and self._args.trainer:
            logger.debug("Trainer name provided: '%s'", self._args.trainer)
            return self._args.trainer </s> remove         output_dir = get_folder(self.args.output_dir)
        logger.info("Output Directory: %s", output_dir)

    def add_queues(self):
        """ Add the queues for convert """
        logger.debug("Adding queues. Queue size: %s", self.queue_size)
 </s> add         if (self._args.mask_type not in ("none", "predicted") and
                not self._alignments.mask_is_valid(self._args.mask_type)):
            msg = ("You have selected the Mask Type `{}` but at least one face does not have this "
                   "mask stored in the Alignments File.\nYou should generate the required masks "
                   "with the Mask Tool or set the Mask Type option to an existing Mask Type.\nA "
                   "summary of existing masks is as follows:\nTotal faces: {}, Masks: "
                   "{}".format(self._args.mask_type, self._alignments.faces_count,
                               self._alignments.mask_summary))
            raise FaceswapError(msg)
        if self._args.mask_type == "predicted" and not self._predictor.has_predicted_mask:
            available_masks = [k for k, v in self._alignments.mask_summary.items()
                               if k != "none" and v == self._alignments.faces_count]
            if not available_masks:
                msg = ("Predicted Mask selected, but the model was not trained with a mask and no "
                       "masks are stored in the Alignments File.\nYou should generate the "
                       "required masks with the Mask Tool or set the Mask Type to `none`.")
                raise FaceswapError(msg)
            mask_type = available_masks[0]
            logger.warning("Predicted Mask selected, but the model was not trained with a "
                           "mask. Selecting first available mask: '%s'", mask_type)
            self._args.mask_type = mask_type

    def _add_queues(self):
        """ Add the queues for in, patch and out. """
        logger.debug("Adding queues. Queue size: %s", self._queue_size) </s> remove     def get_batchsize(queue_size):
        """ Get the batchsize """
 </s> add     def _get_batchsize(queue_size):
        """ Get the batch size for feeding the model.

        Sets the batch size to 1 if inference is being run on CPU, otherwise the minimum of the
        :attr:`self._queue_size` and 16.

        Returns
        -------
        int
            The batch size that the model is to be fed at.
        """
            raise FaceswapError("{} does not exist.".format(self._args.model_dir))
        trainer = self._get_model_name(model_dir)
        gpus = 1 if not hasattr(self._args, "gpus") else self._args.gpus
          """ Load the model requested for conversion """
          logger.debug("Loading Model")
          model_dir = get_folder(self.args.model_dir, make_folder=False)
          if not model_dir:
            raise FaceswapError("{} does not exist.".format(self._args.model_dir))
        trainer = self._get_model_name(model_dir)
        gpus = 1 if not hasattr(self._args, "gpus") else self._args.gpus
            raise FaceswapError("{} does not exist.".format(self._args.model_dir))
        trainer = self._get_model_name(model_dir)
        gpus = 1 if not hasattr(self._args, "gpus") else self._args.gpus
            raise FaceswapError("{} does not exist.".format(self._args.model_dir))
        trainer = self._get_model_name(model_dir)
        gpus = 1 if not hasattr(self._args, "gpus") else self._args.gpus
          model = PluginLoader.get_model(trainer)(model_dir, gpus, predict=True)
          logger.debug("Loaded Model")
          return model
  
      def get_trainer(self, model_dir):
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 
scripts/convert.py