                  img = ".gui_training_preview.jpg"
                  imgfile = os.path.join(scriptpath, "lib", "gui",
                                         ".cache", "preview", img)
                  cv2.imwrite(imgfile, image)  # pylint: disable=no-member
                  logger.debug("Generated preview for GUI: '%s'", img)
              if self._args.preview:
                  logger.debug("Generating preview for display: '%s'", name)
                  self._preview.add_image(name, image)
                  logger.debug("Generated preview for display: '%s'", name)
          except Exception as err:
 
</s> remove                         if self._full_size:  # This can only be true if preview was closed
 </s> add                         if self._triggers["full_size"]:  # Can only be true if preview was closed </s> remove         if self._full_size:
 </s> add         if self._triggers["full_size"]: </s> remove         then resets :attr:`_toggle_mask` back to ``False``
 </s> add         then resets mask toggle back to ``False`` </s> remove             retval = self._refresh
 </s> add             retval = self._triggers["refresh"] </s> remove     @property
    def _toggle_size(self) -> bool:
        return self._full_size

    @_toggle_size.setter
    def _toggle_size(self, value: bool) -> None:  # pylint:disable=unused-argument
        """ Toggle between actual size and screen-fit size.

        Parameters
        ----------
        value: bool
            Unused, but required for setter. The size will check the previous state and switch it
            to the opposite state
        """
        self._full_size = not self._full_size
 </s> add     def _toggle_size(self) -> None:  # pylint:disable=unused-argument
        """ Toggle between actual size and screen-fit size. """
        self._triggers["full_size"] = not self._triggers["full_size"]
                logger.debug("Generated preview for GUI: '%s'", imgfile)
                  img = ".gui_training_preview.jpg"
                  imgfile = os.path.join(scriptpath, "lib", "gui",
                                         ".cache", "preview", img)
                  cv2.imwrite(imgfile, image)  # pylint: disable=no-member
                logger.debug("Generated preview for GUI: '%s'", imgfile)
              if self._args.preview:
                  logger.debug("Generating preview for display: '%s'", name)
                  self._preview.add_image(name, image)
                  logger.debug("Generated preview for display: '%s'", name)
          except Exception as err:
keep keep keep keep replace keep keep keep keep keep
 bugfix: Update preview screen in GUI 
scripts/train.py