          if skipframe and self.args.discard_frames:
              skipframe = "discard"
          return skipframe
  
      def check_skipface(self, filename, face_idx):
          """ Check whether face is to be skipped """
          if self.faces_to_swap is None:
              return False
          face_name = "{}_{}{}".format(Path(filename).stem,
                                       face_idx,
                                       Path(filename).suffix)
          face_file = Path(self.args.input_aligned_dir) / Path(face_name)
          skip_face = face_file not in self.faces_to_swap
          if skip_face:
              logger.info("face %s for frame '%s' was deleted, skipping",
                          face_idx, os.path.basename(filename))
          return skip_face
  
  
  class Legacy():
      """ Update legacy alignments:
  
          - Add frame dimensions
 
</s> remove         and remove the 'r' parameter """
 </s> add           and remove the 'r' parameter
        - Add face hashes to alignments file
    """ </s> remove         and remove the 'r' parameter """
    def __init__(self, alignments, frames):
 </s> add         and remove the 'r' parameter
        - Add face hashes to alignments file
        """
    def __init__(self, alignments, frames, faces_dir): </s> remove     def rename_faces(self):
        """ Rename the aligned faces to match their "
            new index in alignments file """
        current_frame = ""
        current_index = 0
        rename_count = 0
        for face in tqdm(self.items.file_list_sorted,
                         desc="Renaming aligned faces",
                         total=self.items.count):

            if face["frame_name"] not in self.removed:
                continue
            current_index, current_frame = self.set_image_index(
                current_index,
                current_frame,
                face["frame_name"])
            if current_index != face["face_index"]:
                rename_count += self.rename_file(face,
                                                 current_frame,
                                                 current_index)

            current_index += 1
        if rename_count == 0:
            logger.info("No files were renamed. Exiting")
            return
        logger.info("%s face(s) were renamed to match with alignments file", rename_count)

    @staticmethod
    def set_image_index(index, current, original):
        """ Set the current processing image and index """
        idx = 0 if current != original else index
        return idx, original

    def rename_file(self, face, frame_name, index):
        """ Rename the selected file """
        old_file = face["face_name"] + face["face_extension"]
        new_file = "{}_{}{}".format(frame_name,
                                    str(index),
                                    face["face_extension"])
        src = os.path.join(self.items.folder, old_file)
        dst = os.path.join(self.items.folder, new_file)
        os.rename(src, dst)
        logger.verbose("Renamed '%s' to '%s'", src, dst)
        return 1

 </s> add 
          if skipframe and self.args.discard_frames:
              skipframe = "discard"
          return skipframe
  














  
  class Legacy():
      """ Update legacy alignments:
  
          - Add frame dimensions
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Add Face Hashes to Alignments (#550)

* Convert main scripts to use face hashes

* Alignment tool: Use hashes, add logging, add face rename function

* More logging. Update Manual tool to work with hashing 
scripts/convert.py