  [mypy-imageio_ffmpeg.*]
  ignore_missing_imports = True
  [mypy-keras.*]
  ignore_missing_imports = True
  [mypy-plaidml.*]
  ignore_missing_imports = True
  [mypy-psutil.*]
  ignore_missing_imports = True
 
</s> remove             if save_iteration or self._save_now or self._refresh_preview:
 </s> add             if self._preview.should_refresh(): </s> remove                     self._do_preview(window_created)
                    cv_key = cv2.waitKey(1000)  # pylint: disable=no-member
                else:
                    cv_key = None
 </s> add                     self._preview.display_preview() </s> remove     def _preview_monitor(self, key_press: str) -> bool:
        """ Monitors keyboard presses on the pop-up OpenCV Preview Window.

        Parameters
        ----------
        key_press: str
            The key press received from OpenCV or ``None`` if no press received

        Returns
        -------
        bool
            ``True`` if the process should continue training. ``False`` if an exit has been
            requested and process should terminate
        """
        if not self._args.preview:
            return True

        if key_press == ord("\n") or key_press == ord("\r"):
            logger.debug("Exit requested")
            return False

        if key_press == ord("s"):
            print("\n")
            logger.info("Save requested")
            self._save_now = True
        if key_press == ord("r"):
            print("\n")
            logger.info("Refresh preview requested")
            self._refresh_preview = True
        if key_press == ord("m"):
            print("\n")
            logger.verbose("Toggle mask display requested")  # type:ignore
            self._toggle_preview_mask = True

        return True

 </s> add 
[mypy-matplotlib.*]
ignore_missing_imports = True
  [mypy-imageio_ffmpeg.*]
  ignore_missing_imports = True
  [mypy-keras.*]
  ignore_missing_imports = True
[mypy-matplotlib.*]
ignore_missing_imports = True
  [mypy-plaidml.*]
  ignore_missing_imports = True
  [mypy-psutil.*]
  ignore_missing_imports = True
keep keep keep add keep keep keep keep
 Live Preview - Replace cv2 with matplotlib viewer 
setup.cfg