          self._gui_triggers = dict(update=os.path.join(gui_cache, ".preview_trigger"),
                                    mask_toggle=os.path.join(gui_cache, ".preview_mask_toggle"))
          self._stop: bool = False
          self._save_now: bool = False
          self._toggle_preview_mask: bool = False
          self._refresh_preview: bool = False
          self._preview_buffer: Dict[str, np.ndarray] = {}
          self._lock = Lock()
  
          logger.debug("Initialized %s", self.__class__.__name__)
  
      def _get_images(self) -> Dict[Literal["a", "b"], List[str]]:
          """ Check the image folders exist and contains valid extracted faces. Obtain image paths.
 
</s> remove             if save_iteration or self._save_now or self._refresh_preview:
 </s> add             if self._preview.should_refresh(): </s> remove                 self._toggle_preview_mask = False
                self._refresh_preview = True
 </s> add                 self._preview.request_refresh() </s> remove             if self._refresh_preview and viewer is not None:
                if self._args.redirect_gui:  # Remove any gui trigger files following an update
                    print("\n")
                    logger.info("[Preview Updated]")
                self._refresh_preview = False

            if save_iteration:
                logger.debug("Save Iteration: (iteration: %s", iteration)
                model.save(is_exit=False)
            elif self._save_now:
                logger.debug("Save Requested: (iteration: %s", iteration)
 </s> add             if save_iteration or self._save_now:
                logger.debug("Saving (save_iterations: %s, save_now: %s) Iteration: "
                             "(iteration: %s)", save_iteration, self._save_now, iteration) </s> remove         self._scaling = scaling
 </s> add  </s> remove             if self._toggle_preview_mask:
 </s> add             if self._preview.should_toggle_mask():
        self._preview = Preview()
          self._gui_triggers = dict(update=os.path.join(gui_cache, ".preview_trigger"),
                                    mask_toggle=os.path.join(gui_cache, ".preview_mask_toggle"))
          self._stop: bool = False
          self._save_now: bool = False
        self._preview = Preview()
        self._preview = Preview()
        self._preview = Preview()
        self._preview = Preview()
  
          logger.debug("Initialized %s", self.__class__.__name__)
  
      def _get_images(self) -> Dict[Literal["a", "b"], List[str]]:
          """ Check the image folders exist and contains valid extracted faces. Obtain image paths.
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Live Preview - Replace cv2 with matplotlib viewer 
scripts/train.py