          Utils.finalize(self.images.images_found // self.skip_num,
                         self.alignments.faces_count,
                         self.verify_output)
  
      def threaded_io(self, task, io_args=None):
          """ Perform I/O task in a background thread """
          logger.debug("Threading task: (Task: '%s')", task)
          io_args = tuple() if io_args is None else (io_args, )
          if task == "load":
              func = self.load_images
          elif task == "save":
 
</s> remove         if task == "load":
            func = self.load_images
        elif task == "save":
            func = self.save_faces
        elif task == "reload":
            func = self.reload_images
 </s> add         func = getattr(self, "_{}".format(task)) </s> remove         self.alignments.save()
        Utils.finalize(self.images.images_found // self.skip_num,
                       self.alignments.faces_count,
                       self.verify_output)
 </s> add         self._alignments.save()
        Utils.finalize(self._images.process_count + self._existing_count,
                       self._alignments.faces_count,
                       self._verify_output) </s> remove         self.threaded_io("load")
        self.threaded_io("save")
        self.run_extraction()
        for thread in self.threads:
 </s> add         self._threaded_redirector("load")
        self._run_extraction()
        for thread in self._threads: </s> remove         self.threads.append(io_thread)
 </s> add         self._threads.append(io_thread)

    def _load(self):
        """ Load the images </s> remove     >>> saver = BackgroundIO('/path/to/save/folder', 'save')
    >>> for filename, image in <image_iterator>:
    >>>     saver.save(filename, image)
    >>> saver.close()
    """
 </s> add         args = (load_with_hash, )
        super().__init__(path, queue_size=queue_size, args=args)
        self._skip_list = set() if skip_list is None else set(skip_list)
    def _threaded_redirector(self, task, io_args=None):
        """ Redirect image input/output tasks to relevant queues in background thread

        Parameters
        ----------
        task: str
            The name of the task to be put into a background thread
        io_args: tuple, optional
            Any arguments that need to be provided to the background function
        """
          Utils.finalize(self.images.images_found // self.skip_num,
                         self.alignments.faces_count,
                         self.verify_output)
  
    def _threaded_redirector(self, task, io_args=None):
        """ Redirect image input/output tasks to relevant queues in background thread

        Parameters
        ----------
        task: str
            The name of the task to be put into a background thread
        io_args: tuple, optional
            Any arguments that need to be provided to the background function
        """
    def _threaded_redirector(self, task, io_args=None):
        """ Redirect image input/output tasks to relevant queues in background thread

        Parameters
        ----------
        task: str
            The name of the task to be put into a background thread
        io_args: tuple, optional
            Any arguments that need to be provided to the background function
        """
          logger.debug("Threading task: (Task: '%s')", task)
          io_args = tuple() if io_args is None else (io_args, )
          if task == "load":
              func = self.load_images
          elif task == "save":
keep keep keep keep replace replace keep keep keep keep keep
 scripts.extract - code optimizations

Limit queue sizes to reduce RAM usage
Rename lib.image.BackgroundIO to ImageIO
Create separate ImagesLoader and ImagesSaver classes
Load/Save images from centralized lib.image.ImageIO
scripts.extract documentation 
scripts/extract.py