  from typing import Any, Callable, cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
  import os
  import sys
  
  from configparser import ConfigParser
  from threading import Event, Lock, Thread
  
  import cv2
  import numpy as np
  from PIL import Image, ImageTk
 
</s> remove from typing import Any, Callable, cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
 </s> add from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING, Union </s> remove import cv2
 </s> add  </s> remove from PIL import Image, ImageTk
 </s> add  </s> remove from lib.align import DetectedFace, transform_image
 </s> add from lib.align import DetectedFace
  from typing import Any, Callable, cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
  import os
  import sys
  

  from threading import Event, Lock, Thread
  
  import cv2
  import numpy as np
  from PIL import Image, ImageTk
keep keep keep keep replace keep keep keep keep keep
 bugfix:
    - preview tool - Prevent tkinter variables from exiting main thread
refactor:
    - preview tool - Split module to smaller sub-modules + docs, locales
Typing:
    - tools.preview.cli
Unit test:
    - tools.preview.viewer 
tools/preview/preview.py