              faces = self._process_legacy(filename, image, faces)
  
          for idx, face in enumerate(faces):
              output = f"{frame_name}_{idx}.png"
              meta: PNGHeaderDict = dict(
                  alignments=face.to_png_meta(),
                  source=dict(alignments_version=self._alignments.version,
                              original_filename=output,
                              face_index=idx,
                              source_filename=filename,
                              source_is_video=self._frames.is_video,
                              source_frame_dims=cast(Tuple[int, int], image.shape[:2])))
              assert face.aligned.face is not None
              self._saver.save(output, encode_image(face.aligned.face, ".png", metadata=meta))
              if self._min_size == 0 and self._is_legacy:
                  face.thumbnail = generate_thumbnail(face.aligned.face, size=96, quality=60)
                  self._alignments.data[filename]["faces"][idx] = face.to_alignment()
 
</s> remove             meta: PNGHeaderDict = dict(
                alignments=face.to_png_meta(),
                source=dict(alignments_version=self._alignments.version,
                            original_filename=output_filename,
                            face_index=real_face_id,
                            source_filename=os.path.basename(extract_media.filename),
                            source_is_video=self._loader.is_video,
                            source_frame_dims=extract_media.image_size))
 </s> add             meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output_filename,
                           "face_index": real_face_id,
                           "source_filename": os.path.basename(extract_media.filename),
                           "source_is_video": self._loader.is_video,
                           "source_frame_dims": extract_media.image_size}} </s> remove         retval: T.List[DetectedFace] = []
 </s> add         retval: list[DetectedFace] = [] </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         retval: List["DetectedFace"] = []
 </s> add         retval: list[DetectedFace] = [] </s> remove         sub_folders: List[Optional[str]] = [None for _ in range(len(faces))]
 </s> add         sub_folders: list[str | None] = [None for _ in range(len(faces))]
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
              faces = self._process_legacy(filename, image, faces)
  
          for idx, face in enumerate(faces):
              output = f"{frame_name}_{idx}.png"
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
            meta: PNGHeaderDict = {
                "alignments": face.to_png_meta(),
                "source": {"alignments_version": self._alignments.version,
                           "original_filename": output,
                           "face_index": idx,
                           "source_filename": filename,
                           "source_is_video": self._frames.is_video,
                           "source_frame_dims": T.cast(tuple[int, int], image.shape[:2])}}
              assert face.aligned.face is not None
              self._saver.save(output, encode_image(face.aligned.face, ".png", metadata=meta))
              if self._min_size == 0 and self._is_legacy:
                  face.thumbnail = generate_thumbnail(face.aligned.face, size=96, quality=60)
                  self._alignments.data[filename]["faces"][idx] = face.to_alignment()
keep keep keep keep replace replace replace replace replace replace replace 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 
tools/alignments/jobs_frames.py