  
      def export_faces(self):
          """ Export the faces """
          extracted_faces = 0
          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)
                  continue
  
              if not self.alignments.frame_exists(frame_name):
                  logger.verbose("Skipping '%s' - Alignments not found", frame_name)
                  continue
 
</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     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             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         logger.verbose("Creating output folder at '%s'", self.faces_dir)
 </s> add         logger.verbose("Creating output folder at '%s'", self._faces_dir)
        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)
  
      def export_faces(self):
          """ Export the faces """
          extracted_faces = 0
        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)
        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)
        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)
        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)
        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)
        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)
        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)
        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)
                  continue
  
              if not self.alignments.frame_exists(frame_name):
                  logger.verbose("Skipping '%s' - Alignments not found", frame_name)
                  continue
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 lib.alignments: improve re-extraction speed by 500% 
tools/lib_alignments/jobs.py