                                      total=count, desc="Saving extracted faces"):
              if not self._alignments.frame_exists(filename):
                  logger.verbose("Skipping '%s' - Alignments not found", filename)
                  continue
  
      def _set_skip_list(self):
          """ Set the indices for frames that should be skipped based on the `extract_every_n`
          command line option.
  
          Returns
 
</s> remove             if not self.alignments.frame_exists(frame_name):
                logger.verbose("Skipping '%s' - Alignments not found", frame_name)
                continue
 </s> add     def _set_skip_list(self):
        """ Set the indices for frames that should be skipped based on the `extract_every_n`
        command line option.

        Returns
        -------
        list or ``None``
            A list of indices to be skipped if extract_every_n is not `1` otherwise
            returns ``None``
        """
        skip_num = self._arguments.extract_every_n
        if skip_num == 1:
            logger.debug("Not skipping any frames")
            return None
        skip_list = []
        for idx, item in enumerate(self._frames.file_list_sorted):
            if idx % skip_num != 0:
                logger.trace("Adding image '%s' to skip list due to extract_every_n = %s",
                             item["frame_fullname"], skip_num)
                skip_list.append(idx)
        logger.debug("Adding skip list: %s", skip_list)
        return skip_list </s> remove         skip_num = self.arguments.extract_every_n
        if skip_num != 1:
            logger.info("Skipping every %s frames", skip_num)
        for idx, frame in enumerate(tqdm(self.frames.file_list_sorted,
                                         desc="Saving extracted faces")):
            frame_name = frame["frame_fullname"]
            if idx % skip_num != 0:
                logger.trace("Skipping '%s' due to extract_every_n = %s", frame_name, skip_num)
 </s> add         skip_list = self._set_skip_list()
        count = self._frames.count if skip_list is None else self._frames.count - len(skip_list)
        for filename, image in tqdm(self._frames.stream(skip_list=skip_list),
                                    total=count, desc="Saving extracted faces"):
            if not self._alignments.frame_exists(filename):
                logger.verbose("Skipping '%s' - Alignments not found", filename) </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 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     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:
            extracted_faces += self._output_faces(filename, image)
        if extracted_faces != 0 and not self._arguments.large:
            self._alignments.save()
        logger.info("%s face(s) extracted", extracted_faces)
                                      total=count, desc="Saving extracted faces"):
              if not self._alignments.frame_exists(filename):
                  logger.verbose("Skipping '%s' - Alignments not found", filename)
                  continue
            extracted_faces += self._output_faces(filename, image)
        if extracted_faces != 0 and not self._arguments.large:
            self._alignments.save()
        logger.info("%s face(s) extracted", extracted_faces)
  
      def _set_skip_list(self):
          """ Set the indices for frames that should be skipped based on the `extract_every_n`
          command line option.
  
          Returns
keep keep keep add keep keep keep keep keep keep
 lib.alignments: improve re-extraction speed by 500% 
tools/lib_alignments/jobs.py