  from PIL import Image, ImageDraw, ImageTk
  
  from .config import get_config, PATHCACHE
  
  if sys.version_info < (3, 8):
      from typing_extensions import Literal
  else:
 
</s> remove from typing import cast, Dict, List, Optional, Sequence, Tuple, Union
 </s> add from typing import cast, Dict, List, Optional, Sequence, Tuple </s> remove if TYPE_CHECKING:
    from PIL import Image

 </s> add  </s> remove from .augmentation import ImageAugmentation  # noqa
from .generator import PreviewDataGenerator, TrainingDataGenerator  # noqa
from .preview_cv import PreviewBuffer , TriggerType # noqa
 </s> add from .augmentation import ImageAugmentation
from .generator import PreviewDataGenerator, TrainingDataGenerator
from .preview_cv import PreviewBuffer, TriggerType </s> remove from typing import cast, Dict, Optional, Tuple, TYPE_CHECKING
 </s> add from typing import Dict, Optional, Tuple

from lib.training.preview_tk import PreviewTk
from lib.training.preview_cv import PreviewBuffer

  from PIL import Image, ImageDraw, ImageTk
  
from lib.training.preview_cv import PreviewBuffer

  from .config import get_config, PATHCACHE
  
  if sys.version_info < (3, 8):
      from typing_extensions import Literal
  else:
keep add keep keep keep keep keep
 GUI - Preview updates
  - Training preview. Embed preview pop-out window
  - Bugfix - convert/extract previews 
lib/gui/utils/image.py