              if item.startswith(".gui_training_preview") and item.endswith(".jpg"):
                  fullitem = os.path.join(self._pathpreview, item)
                  logger.debug("Deleting: '%s'", fullitem)
                  os.remove(fullitem)
          for fname in self._previewcache["filenames"]:
              if os.path.basename(fname) == ".gui_preview.jpg":
                  logger.debug("Deleting: '%s'", fname)
                  try:
                      os.remove(fname)
                  except FileNotFoundError:
 
</s> remove     def _clear_image_cache(self):
 </s> add     def _clear_image_cache(self) -> None: </s> remove         samples = []
 </s> add         samples: List[np.ndarray] = [] </s> remove             if command in ("extract", "convert") and opt == "-o":
                get_images().set_faceswap_output_path(optval)
 </s> add             if command in ("extract", "convert") and opt == "-o":  # Output location for preview
                output_dir = optval
            if command == "extract" and opt == "-b":               # Check for batch mode
                batch_mode = optval </s> remove             return None
 </s> add             return []
        for fname in cast(List[str], self._previewcache["filenames"]):
              if item.startswith(".gui_training_preview") and item.endswith(".jpg"):
                  fullitem = os.path.join(self._pathpreview, item)
                  logger.debug("Deleting: '%s'", fullitem)
                  os.remove(fullitem)
        for fname in cast(List[str], self._previewcache["filenames"]):
              if os.path.basename(fname) == ".gui_preview.jpg":
                  logger.debug("Deleting: '%s'", fname)
                  try:
                      os.remove(fname)
                  except FileNotFoundError:
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Preview for extract in batch mode 
lib/gui/utils.py