  import os
  import sys
  
  from configparser import ConfigParser
  from threading import Event, Lock
  
  import cv2
  import numpy as np
  from PIL import Image, ImageTk
  
 
</s> remove from lib.multithreading import MultiThread
 </s> add  </s> remove         self._thread = MultiThread(self._process,
                                   self._trigger,
                                   self._shutdown,
                                   self._queue_patch_in,
                                   self._samples,
                                   tk_vars,
                                   thread_count=1,
                                   name="patch_thread")
 </s> add         self._thread = Thread(target=self._process,
                              name="patch_thread",
                              args=(self._trigger,
                                    self._shutdown,
                                    self._queue_patch_in,
                                    self._samples,
                                    tk_vars),
                              daemon=True) </s> remove             mask = predicted_mask
 </s> add             mask = self._process_predicted_mask(predicted_mask)
from threading import Event, Lock, Thread
  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
  
keep keep keep keep replace keep keep keep keep keep
 Preview Tool fixes
  - Prevent errors from getting swallowed
  - Correctly handle None mask type
  - Consistent box blending 
tools/preview/preview.py