          if extracted_faces != 0 and not self.arguments.large:
              self.alignments.save()
          logger.info("%s face(s) extracted", extracted_faces)
  
      def output_faces(self, frame):
          """ Output the frame's faces to file """
          logger.trace("Outputting frame: %s", frame)
          face_count = 0
          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> 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         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 </s> remove             extracted_faces += self.output_faces(frame)
 </s> add     def _output_faces(self, filename, image):
        """ For each frame save out the faces and update the face hash back to alignments </s> remove     def export_faces(self):
        """ Export the faces """
 </s> add     def _export_faces(self):
        """ Export the faces to the output folder and update the alignments file with
        new hashes. """ </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:
        Returns
        -------
        int
            The total number of faces that have been extracted
        """
        logger.trace("Outputting frame: %s", filename)
          if extracted_faces != 0 and not self.arguments.large:
              self.alignments.save()
          logger.info("%s face(s) extracted", extracted_faces)
  
        Returns
        -------
        int
            The total number of faces that have been extracted
        """
        logger.trace("Outputting frame: %s", filename)
        Returns
        -------
        int
            The total number of faces that have been extracted
        """
        logger.trace("Outputting frame: %s", filename)
        Returns
        -------
        int
            The total number of faces that have been extracted
        """
        logger.trace("Outputting frame: %s", filename)
          face_count = 0
          frame_fullname = frame["frame_fullname"]
          frame_name = frame["frame_name"]
          extension = os.path.splitext(frame_fullname)[1]
          faces = self.select_valid_faces(frame_fullname)
keep keep keep keep replace replace replace keep keep keep keep keep
 lib.alignments: improve re-extraction speed by 500% 
tools/lib_alignments/jobs.py