          """ Clear all cached images. """
          logger.debug("Clearing image cache")
          self._pathoutput = None
          self._previewoutput = None
          self._previewtrain = {}
          self._previewcache = dict(modified=None,  # cache for extract and convert
                                    images=None,
                                    filenames=[],
 
</s> remove     def _clear_image_cache(self):
 </s> add     def _clear_image_cache(self) -> None: </s> remove         self._pathoutput = None
        self._previewoutput = None
        self._previewtrain = {}
        self._previewcache = dict(modified=None,  # cache for extract and convert
                                  images=None,
                                  filenames=[],
                                  placeholder=None)
 </s> add         self._pathoutput: Optional[str] = None
        self._batch_mode = False
        self._previewoutput: Optional[Tuple[Image.Image, ImageTk.PhotoImage]] = None
        self._previewtrain: Dict[str, List[Union[Image.Image,
                                                 ImageTk.PhotoImage,
                                                 None,
                                                 float]]] = {}
        self._previewcache: Dict[str, Union[None, float, np.ndarray, List[str]]] = dict(
            modified=None,  # cache for extract and convert
            images=None,
            filenames=[],
            placeholder=None) </s> remove     def __init__(self):
 </s> add     def __init__(self) -> None: </s> remove     def load_training_preview(self):
 </s> add     def load_training_preview(self) -> None: </s> remove             cache = samples[-num_images:]
 </s> add             cache = asamples[-num_images:]
        self._batch_mode = False
          """ Clear all cached images. """
          logger.debug("Clearing image cache")
          self._pathoutput = None
        self._batch_mode = False
          self._previewoutput = None
          self._previewtrain = {}
          self._previewcache = dict(modified=None,  # cache for extract and convert
                                    images=None,
                                    filenames=[],
keep keep add keep keep keep keep keep
 Bugfix: Preview for extract in batch mode 
lib/gui/utils.py