          self.current_config = config_tools.config
          self.converter_arguments = None  # Updated converter arguments dict
  
          configfile = arguments.configfile if hasattr(arguments, "configfile") else None
          self.converter = Converter(output_dir=None,
                                     output_size=self.samples.predictor.output_size,
                                     output_has_mask=self.samples.predictor.has_predicted_mask,
                                     draw_transparent=False,
                                     pre_encode=None,
                                     configfile=configfile,
                                     arguments=self.generate_converter_arguments(arguments))
  
          self.shutdown = Event()
  
          self.thread = MultiThread(self.process,
                                    self.trigger,
                                    self.shutdown,
                                    self.queue_patch_in,
                                    self.samples,
                                    tk_vars,
                                    thread_count=1,
                                    name="patch_thread")
          self.thread.start()
  
      @staticmethod
      def generate_converter_arguments(arguments):
          """ Get the default converter arguments """
          converter_arguments = ConvertArgs(None, "convert").get_optional_arguments()
 
</s> remove         self.samples = samples
        self.queue_patch_in = queue_manager.get_queue("preview_patch_in")
        self.display = display
        self.lock = lock
        self.trigger = trigger
 </s> add         self._samples = samples
        self._queue_patch_in = queue_manager.get_queue("preview_patch_in")
        self._display = display
        self._lock = lock
        self._trigger = trigger </s> remove     def generate_converter_arguments(arguments):
        """ Get the default converter arguments """
 </s> add     def _generate_converter_arguments(arguments):
        """ Add the default converter arguments to the initial arguments.

        Parameters
        ----------
        arguments: :class:`argparse.Namespace`
            The :mod:`argparse` arguments as passed in from :mod:`tools.py`

        Returns
        ----------
        arguments: :class:`argparse.Namespace`
            The :mod:`argparse` arguments as passed in with converter default
            arguments added
        """ </s> remove         self.args = arguments

        self.patch_threads = None
        self.images = Images(self.args)
        self.validate()
        self.alignments = Alignments(self.args, False, self.images.is_video)
        self.opts = OptionalActions(self.args, self.images.input_images, self.alignments)

        self.add_queues()
        self.disk_io = DiskIO(self.alignments, self.images, arguments)
        self.predictor = Predict(self.disk_io.load_queue, self.queue_size, arguments)

        configfile = self.args.configfile if hasattr(self.args, "configfile") else None
        self.converter = Converter(get_folder(self.args.output_dir),
                                   self.predictor.output_size,
                                   self.predictor.has_predicted_mask,
                                   self.disk_io.draw_transparent,
                                   self.disk_io.pre_encode,
                                   arguments,
                                   configfile=configfile)
 </s> add         self._args = arguments

        self._patch_threads = None
        self._images = Images(self._args)
        self._alignments = Alignments(self._args, False, self._images.is_video)

        self._opts = OptionalActions(self._args, self._images.input_images, self._alignments)

        self._add_queues()
        self._disk_io = DiskIO(self._alignments, self._images, arguments)
        self._predictor = Predict(self._disk_io.load_queue, self._queue_size, arguments)
        self._validate()
        get_folder(self._args.output_dir)

        configfile = self._args.configfile if hasattr(self._args, "configfile") else None
        self._converter = Converter(self._predictor.output_size,
                                    self._predictor.coverage_ratio,
                                    self._disk_io.draw_transparent,
                                    self._disk_io.pre_encode,
                                    arguments,
                                    configfile=configfile) </s> remove     def update_converter_arguments(self):
        """ Update the converter arguments """
 </s> add     def _update_converter_arguments(self):
        """ Update the converter arguments to the currently selected values. """ </s> remove         """ Return a dict of cli arguments for converter based on selected options """
 </s> add         """ dict: Currently selected Command line arguments from the :class:`ActionFrame`. """
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
          self.current_config = config_tools.config
          self.converter_arguments = None  # Updated converter arguments dict
  
          configfile = arguments.configfile if hasattr(arguments, "configfile") else None
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
        self._converter = Converter(output_size=self._samples.predictor.output_size,
                                    coverage_ratio=self._samples.predictor.coverage_ratio,
                                    draw_transparent=False,
                                    pre_encode=None,
                                    arguments=self._generate_converter_arguments(arguments),
                                    configfile=configfile)
        self._shutdown = Event()

        self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
        self._thread.start()

    @property
    def trigger(self):
        """ :class:`threading.Event`: The trigger to indicate that a patching run should
        commence. """
        return self._trigger

    @property
    def converter(self):
        """ :class:`lib.convert.Converter`: The converter to use for patching the images. """
        return self._converter
  
      @staticmethod
      def generate_converter_arguments(arguments):
          """ Get the default converter arguments """
          converter_arguments = ConvertArgs(None, "convert").get_optional_arguments()
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace 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 
tools/preview.py