                                                  total=self.alignments.frames_count):
              rename_count += self.rename_faces(frame, frame_fullname)
          logger.info("%s faces renamed", rename_count)
  
      def rename_faces(self, frame, frame_fullname):
          """ Rename faces
              Done in 2 iterations as two files cannot share the same name """
          logger.trace("Renaming faces for frame: '%s'", frame_fullname)
          temp_ext = ".temp_move"
          frame_faces = list()
 
</s> remove             rename_count += self.rename_faces(frame, frame_fullname)
 </s> add             rename_count += self.rename_faces(frame, frame_fullname, details) </s> remove         frame_faces = list()
        frame_faces = [(f_hash, idx)
                       for f_hash, details in self.alignments.hashes_to_frame.items()
                       for frame_name, idx in details.items()
                       if frame_name == frame_fullname]
 </s> add         frame_faces = [(x["hash"], idx) for idx, x in enumerate(details)] </s> remove         for frame, _, _, frame_fullname in tqdm(self.alignments.yield_faces(),
 </s> add         for frame, details, _, frame_fullname in tqdm(self.alignments.yield_faces(), </s> remove     def remove_alignment(self, item):
        """ Remove the alignment from the alignments file """
        del_count = 0
        frame_name, alignments, number_alignments = item[:3]
        for idx in self.alignments.yield_original_index_reverse(alignments, number_alignments):
            face_indexes = self.items.items.get(frame_name, [-1])
            if idx not in face_indexes:
                del alignments[idx]
                self.removed.add(frame_name)
                logger.verbose("Removed alignment data for image: '%s' index: %s",
                               frame_name, str(idx))
                del_count += 1
            else:
                logger.trace("Not removing alignment data for image: '%s' index: %s",
                             frame_name, str(idx))
        return del_count

 </s> add  </s> remove             if not self.alignments.hashes_to_frame.get(f_hash, None):
 </s> add             if f_hash not in hashes_to_frame:
    def rename_faces(self, frame, frame_fullname, details):
                                                  total=self.alignments.frames_count):
              rename_count += self.rename_faces(frame, frame_fullname)
          logger.info("%s faces renamed", rename_count)
  
    def rename_faces(self, frame, frame_fullname, details):
          """ Rename faces
              Done in 2 iterations as two files cannot share the same name """
          logger.trace("Renaming faces for frame: '%s'", frame_fullname)
          temp_ext = ".temp_move"
          frame_faces = list()
keep keep keep keep replace keep keep keep keep keep
 Multiple Tools->Alignmet speed ups (#785) 
tools/lib_alignments/jobs.py