              masks3 = [orig_masks, *pred_masks]
          else:
              masks3 = np.repeat(np.expand_dims(orig_masks, axis=0), 3, axis=0)
  
          retval: T.List[np.ndarray] = []
          alpha = 1.0 - self._mask_opacity
          for previews, compiled_masks in zip(faces, masks3):
              overlays = previews.copy()
              overlays[np.where((compiled_masks == 1.).all(axis=3))] = self._mask_color
              retval.append(np.array([cv2.addWeighted(img, alpha, ovl, self._mask_opacity, 0)
 
</s> remove         masks3: T.Union[T.List[np.ndarray], np.ndarray] = []
 </s> add         masks3: list[np.ndarray] | np.ndarray = [] </s> remove         self.images: T.Dict[Literal["a", "b"], T.List[np.ndarray]] = {}
 </s> add         self.images: dict[T.Literal["a", "b"], list[np.ndarray]] = {} </s> remove             retval: Optional[tk.Frame] = frame
 </s> add             retval: tk.Frame | None = frame </s> remove                 centering: "CenteringType" = ("legacy" if self._alignments is not None and
                                              self._alignments.version == 1.0
                                              else mask.stored_centering)
 </s> add                 centering: CenteringType = ("legacy" if self._alignments is not None and
                                            self._alignments.version == 1.0
                                            else mask.stored_centering) </s> remove         samples: List[np.ndarray] = []
 </s> add         samples: list[np.ndarray] = []
        retval: list[np.ndarray] = []
              masks3 = [orig_masks, *pred_masks]
          else:
              masks3 = np.repeat(np.expand_dims(orig_masks, axis=0), 3, axis=0)
  
        retval: list[np.ndarray] = []
          alpha = 1.0 - self._mask_opacity
          for previews, compiled_masks in zip(faces, masks3):
              overlays = previews.copy()
              overlays[np.where((compiled_masks == 1.).all(axis=3))] = self._mask_color
              retval.append(np.array([cv2.addWeighted(img, alpha, ovl, self._mask_opacity, 0)
keep keep keep keep replace keep keep keep keep keep
 Rebase code (#1326)

* Remove tensorflow_probability requirement

* setup.py - fix progress bars

* requirements.txt: Remove pre python 3.9 packages

* update apple requirements.txt

* update INSTALL.md

* Remove python<3.9 code

* setup.py - fix Windows Installer

* typing: python3.9 compliant

* Update pytest and readthedocs python versions

* typing fixes

* Python Version updates
  - Reduce max version to 3.10
  - Default to 3.10 in installers
  - Remove incompatible 3.11 tests

* Update dependencies

* Downgrade imageio dep for Windows

* typing: merge optional unions and fixes

* Updates
  - min python version 3.10
  - typing to python 3.10 spec
  - remove pre-tf2.10 code
  - Add conda tests

* train: re-enable optimizer saving

* Update dockerfiles

* Update setup.py
  - Apple Conda deps to setup.py
  - Better Cuda + dependency handling

* bugfix: Patch logging to prevent Autograph errors

* Update dockerfiles

* Setup.py - Setup.py - stdout to utf-8

* Add more OSes to github Actions

* suppress mac-os end to end test 
plugins/train/trainer/_base.py