          logger.debug("Initializing %s: (path: %s, task: %s, load_with_hash: %s, queue_size: %s)",
                       self.__class__.__name__, path, task, load_with_hash, queue_size)
          self._location = path
  
          self._task = task.lower()
          self._is_video = self._check_input()
          self._input = self.location if self._is_video else get_image_paths(self.location)
          self._count = count_frames(self._input) if self._is_video else len(self._input)
          self._queue = queue_manager.get_queue(name="{}_{}".format(self.__class__.__name__,
                                                                    self._task),
                                                maxsize=queue_size)
          self._thread = self._set_thread(io_args=(load_with_hash, ))
          self._thread.start()
  
      @property
      def count(self):
          """ int: The number of images or video frames to be processed """
          return self._count
 
</s> remove     def __init__(self, path, task, load_with_hash=False, queue_size=16):
        logger.debug("Initializing %s: (path: %s, task: %s, load_with_hash: %s, queue_size: %s)",
                     self.__class__.__name__, path, task, load_with_hash, queue_size)
        self._location = path
 </s> add         self._is_video = self._check_for_video() </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) </s> remove     Saving out images:
 </s> add     def __init__(self, path, queue_size=8, load_with_hash=False, fast_count=True, skip_list=None):
        logger.debug("Initializing %s: (path: %s, queue_size: %s, load_with_hash: %s, "
                     "fast_count: %s)", self.__class__.__name__, path, queue_size,
                     load_with_hash, fast_count) </s> remove         """ int: The number of images or video frames to be processed """
 </s> add         """ int: The number of images or video frames in the source location. This count includes
        any files that will ultimately be skipped if a :attr:`skip_list` has been provided. See
        also: :attr:`process_count`"""
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
          logger.debug("Initializing %s: (path: %s, task: %s, load_with_hash: %s, queue_size: %s)",
                       self.__class__.__name__, path, task, load_with_hash, queue_size)
          self._location = path
  
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
        self._count = None
        self._file_list = None
        self._get_count_and_filelist(fast_count)
  
      @property
      def count(self):
          """ int: The number of images or video frames to be processed """
          return self._count
keep keep keep keep replace replace replace replace replace replace replace 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 
lib/image.py