          ----------
          args: tuple
              The arguments to be passed to the load iterator
          """
          queue = args[0]
          io_args = args[1:]
          iterator = self._load_video if self._is_video else self._load_images
          logger.debug("Load iterator: %s", iterator)
          for retval in iterator(*io_args):
              logger.trace("Putting to queue: %s", [v.shape if isinstance(v, np.ndarray) else v
                                                    for v in retval])
              queue.put(retval)
 
</s> remove         for retval in iterator(*io_args):
 </s> add         for retval in iterator():
            filename, image = retval[:2]
            if image is None or (not image.any() and image.ndim not in (2, 3)):
                # All black frames will return not np.any() so check dims too
                logger.warning("Unable to open image. Skipping: '%s'", filename)
                continue </s> remove         args: tuple
            The arguments to be passed to the load iterator
 </s> add         queue: queue.Queue()
            The ImageIO Queue </s> remove         args: tuple
            The save arguments
 </s> add         queue: queue.Queue()
            The ImageIO Queue </s> remove         queue = args[0]
 </s> add         executor = futures.ThreadPoolExecutor(thread_name_prefix=self.__class__.__name__) </s> remove         io_args: tuple, optional
            The arguments to be passed to the load or save thread. Default: `None`.

        Returns
        -------
        :class:`lib.multithreading.MultiThread`: Thread containing the load/save function.
 </s> add         fast_count: bool
            When loading from video, the video needs to be parsed frame by frame to get an accurate
            count. This can be done quite quickly without guaranteed accuracy, or slower with
            guaranteed accuracy. Set to ``True`` to count quickly, or ``False`` to count slower
            but accurately.
        iterator = self._from_video if self._is_video else self._from_folder
          ----------
          args: tuple
              The arguments to be passed to the load iterator
          """
        iterator = self._from_video if self._is_video else self._from_folder
        iterator = self._from_video if self._is_video else self._from_folder
        iterator = self._from_video if self._is_video else self._from_folder
          logger.debug("Load iterator: %s", iterator)
          for retval in iterator(*io_args):
              logger.trace("Putting to queue: %s", [v.shape if isinstance(v, np.ndarray) else v
                                                    for v in retval])
              queue.put(retval)
keep keep keep keep 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