              for item in self._alignments.data[key]["faces"]:
                  face = DetectedFace()
                  face.from_alignment(item, with_thumb=True)
                  this_frame_faces.append(face)
              self._frame_faces.append(this_frame_faces)
  
      def save(self):
          """ Convert updated :class:`~lib.align.DetectedFace` objects to alignments format
          and save the alignments file. """
 
</s> remove         face.mask = self._extractor.get_masks(frame_index, face_index)
 </s> add  </s> remove         faces.extend(deepcopy(self._faces_at_frame_index(idx)))
 </s> add         # aligned_face cannot be deep copied, so remove and recreate
        to_copy = self._faces_at_frame_index(idx)
        for face in to_copy:
            face.aligned = None
        copied = deepcopy(to_copy)

        for old_face, new_face in zip(to_copy, copied):
            old_face.load_aligned(None)
            new_face.load_aligned(None)

        faces.extend(copied) </s> remove         face.mask = self._extractor.get_masks(frame_index, face_index)
 </s> add  </s> remove         face.mask = self._extractor.get_masks(frame_index, face_index)
 </s> add 
                face.load_aligned(None)
                _ = face.aligned.average_distance  # cache the distances
              for item in self._alignments.data[key]["faces"]:
                  face = DetectedFace()
                  face.from_alignment(item, with_thumb=True)
                face.load_aligned(None)
                _ = face.aligned.average_distance  # cache the distances
                  this_frame_faces.append(face)
              self._frame_faces.append(this_frame_faces)
  
      def save(self):
          """ Convert updated :class:`~lib.align.DetectedFace` objects to alignments format
          and save the alignments file. """
keep keep add keep keep keep keep keep keep
 Add Misalignment Detection
  - lib.align.AlignedFace - Add average_distance property (distance from mean_face)
  - tools.manual - Add misaligned Faces filter
  - tools.sort - Add sort by distance (misaligned sort)Add "Misaligned Faces" filter to manual tool 
tools/manual/detected_faces.py