              output = "{}_{}{}".format(frame_name, str(idx), extension)
              if self.arguments.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 """
 
</s> remove             if self.arguments.large:
                self.frames.save_image(self.faces_dir, output, face.aligned_face)
 </s> add             if self._arguments.large:
                self._frames.save_image(self._faces_dir, output, face.aligned_face) </s> remove     def select_valid_faces(self, frame):
        """ Return valid faces for extraction """
        faces = self.extracted_faces.get_faces_in_frame(frame)
        if not self.arguments.large:
 </s> add     def _select_valid_faces(self, frame, image):
        """ Return the aligned faces from a frame that meet the selection criteria,

        Parameters
        ----------
        frame: str
            The filename (without the full path) of the current frame
        image: :class:`numpy.ndarray`
            The full frame that faces are to be extracted from

        Returns
        -------
        list:
            List of valid :class:`lib,faces_detect.DetectedFace` objects
        """
        faces = self._extracted_faces.get_faces_in_frame(frame, image=image)
        if not self._arguments.large: </s> remove         frame_fullname = frame["frame_fullname"]
        frame_name = frame["frame_name"]
        extension = os.path.splitext(frame_fullname)[1]
        faces = self.select_valid_faces(frame_fullname)
 </s> add         frame_name, extension = os.path.splitext(filename)
        faces = self._select_valid_faces(filename, image) </s> remove     def output_faces(self, frame):
        """ Output the frame's faces to file """
        logger.trace("Outputting frame: %s", frame)
 </s> add         Returns
        -------
        int
            The total number of faces that have been extracted
        """
        logger.trace("Outputting frame: %s", filename) </s> remove         if extracted_faces != 0 and not self.arguments.large:
            self.alignments.save()
        logger.info("%s face(s) extracted", extracted_faces)
 </s> add         Parameters
        ----------
        filename: str
            The filename (without the full path) of the current frame
        image: :class:`numpy.ndarray`
            The full frame that faces are to be extracted from
                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[filename][idx]["hash"] = f_hash
              output = "{}_{}{}".format(frame_name, str(idx), extension)
              if self.arguments.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[filename][idx]["hash"] = f_hash
                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[filename][idx]["hash"] = f_hash
                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[filename][idx]["hash"] = f_hash
                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[filename][idx]["hash"] = f_hash
                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[filename][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 replace replace replace keep keep keep keep keep
 lib.alignments: improve re-extraction speed by 500% 
tools/lib_alignments/jobs.py