          frame_name = frame["frame_name"]
          faces = self.select_valid_faces(frame_fullname)
  
          for idx, face in enumerate(faces):
              output = "{}_{}{}".format(frame_name, str(idx), ".png")
              self.frames.save_image(self.faces_dir, output, face.aligned_face)
              face_count += 1
          return face_count
  
      def select_valid_faces(self, frame):
          """ Return valid faces for extraction """
 
</s> remove             return faces
        valid_faces = list()
        sizes = self.extracted_faces.get_roi_size_for_frame(frame)
        for idx, size in enumerate(sizes):
            if size >= self.extracted_faces.size:
                valid_faces.append(faces[idx])
 </s> add             valid_faces = faces
        else:
            sizes = self.extracted_faces.get_roi_size_for_frame(frame)
            valid_faces = [faces[idx]
                           for idx, size in enumerate(sizes)
                           if size >= self.extracted_faces.size]
        logger.trace("frame: '%s', total_faces: %s, valid_faces: %s",
                     frame, len(faces), len(valid_faces)) </s> remove         logger.trace(retval)
 </s> add         logger.trace("'%s': %s", frame, retval) </s> remove         logger.trace(retval)
 </s> add         logger.trace("'%s': %s", frame, retval)
            output = "{}_{}{}".format(frame_name, str(idx), extension)
            if self.type == "large":
                self.frames.save_image(self.faces_dir, output, face.aligned_face)
            else:
                output = os.path.join(self.faces_dir, output)
                f_hash = self.extracted_faces.save_face_with_hash(output,
                                                                  extension,
                                                                  face.aligned_face)
                self.alignments.data[frame_fullname][idx]["hash"] = f_hash
          frame_name = frame["frame_name"]
          faces = self.select_valid_faces(frame_fullname)
  
          for idx, face in enumerate(faces):
            output = "{}_{}{}".format(frame_name, str(idx), extension)
            if self.type == "large":
                self.frames.save_image(self.faces_dir, output, face.aligned_face)
            else:
                output = os.path.join(self.faces_dir, output)
                f_hash = self.extracted_faces.save_face_with_hash(output,
                                                                  extension,
                                                                  face.aligned_face)
                self.alignments.data[frame_fullname][idx]["hash"] = f_hash
            output = "{}_{}{}".format(frame_name, str(idx), extension)
            if self.type == "large":
                self.frames.save_image(self.faces_dir, output, face.aligned_face)
            else:
                output = os.path.join(self.faces_dir, output)
                f_hash = self.extracted_faces.save_face_with_hash(output,
                                                                  extension,
                                                                  face.aligned_face)
                self.alignments.data[frame_fullname][idx]["hash"] = f_hash
              face_count += 1
          return face_count
  
      def select_valid_faces(self, frame):
          """ Return valid faces for extraction """
keep keep keep keep 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 
tools/lib_alignments/jobs.py