                      os.path.splitext(self.location)[1].lower() in _video_extensions)
          if is_video:
              logger.debug("Input is video")
          else:
              logger.debug("Input is folder")
          return is_video
  
      def _set_thread(self, io_args=None):
          """ Set the load/save thread
  
          Parameters
 
</s> remove         is_video = (self._task == "load" and
                    os.path.isfile(self.location) and
                    os.path.splitext(self.location)[1].lower() in _video_extensions)
        if is_video:
            logger.debug("Input is video")
 </s> add         """
        if os.path.isdir(self.location):
            retval = False
        elif os.path.splitext(self.location)[1].lower() in _video_extensions:
            retval = True </s> remove     def _set_thread(self, io_args=None):
        """ Set the load/save thread
 </s> add             If the input is a video, a dummy file list is created for checking against an
            alignments file, otherwise it will be a list of full filenames. </s> remove         if self._task == "save" and not os.path.isdir(self.location):
            raise FaceswapError("The output location '{}' is not a folder".format(self.location))
 </s> add         Raises
        ------
        FaceswapError
            If the given location is a file and does not have a valid video extension. </s> remove     def threaded_io(self, task, io_args=None):
        """ Perform I/O task in a background thread """
 </s> add     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
        """ </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.
            raise FaceswapError("The input file '{}' is not a valid video".format(self.location))
        logger.debug("Input '%s' is_video: %s", self.location, retval)
        return retval

    def _get_count_and_filelist(self, fast_count):
        """ Set the count of images to be processed and set the file list
                      os.path.splitext(self.location)[1].lower() in _video_extensions)
          if is_video:
              logger.debug("Input is video")
          else:
            raise FaceswapError("The input file '{}' is not a valid video".format(self.location))
        logger.debug("Input '%s' is_video: %s", self.location, retval)
        return retval

    def _get_count_and_filelist(self, fast_count):
        """ Set the count of images to be processed and set the file list
            raise FaceswapError("The input file '{}' is not a valid video".format(self.location))
        logger.debug("Input '%s' is_video: %s", self.location, retval)
        return retval

    def _get_count_and_filelist(self, fast_count):
        """ Set the count of images to be processed and set the file list
  
      def _set_thread(self, io_args=None):
          """ Set the load/save thread
  
          Parameters
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 
lib/image.py