          if idx is None:
              # No previous/next frame available
              return
          logger.debug("Copying alignments from frame %s to frame: %s", idx, frame_index)
          faces.extend(deepcopy(self._faces_at_frame_index(idx)))
          self._tk_face_count_changed.set(True)
          self._globals.tk_update.set(True)
  
      def post_edit_trigger(self, frame_index, face_index):
          """ Update the jpg thumbnail and the viewport thumbnail on a face edit.
 
</s> remove         """ Update the jpg thumbnail and the viewport thumbnail on a face edit.
 </s> add         """ Update the jpg thumbnail, the viewport thumbnail, the landmark masks and the aligned
        face on a face edit. </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  </s> remove         face.mask = self._extractor.get_masks(frame_index, face_index)
 </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)
          if idx is None:
              # No previous/next frame available
              return
          logger.debug("Copying alignments from frame %s to frame: %s", idx, frame_index)
        # 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)
          self._tk_face_count_changed.set(True)
          self._globals.tk_update.set(True)
  
      def post_edit_trigger(self, frame_index, face_index):
          """ Update the jpg thumbnail and the viewport thumbnail on a face edit.
keep keep keep keep replace 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