                  logger.debug("Putting EOF to save")
                  self.save_queue.put("EOF")
              else:
                  logger.debug("Reloading images")
                  self.threaded_io("reload", detected_faces)
  
      def check_thread_error(self):
          """ Check and raise thread errors """
          for thread in self.threads:
              thread.check_and_raise_error()
 
</s> remove             if is_final:
                logger.debug("Putting EOF to save")
                self.save_queue.put("EOF")
            else:
 </s> add             if not is_final: </s> remove     def check_thread_error(self):
        """ Check and raise thread errors """
        for thread in self.threads:
 </s> add     def _check_thread_error(self):
        """ Check if any errors have occurred in the running threads and their errors """
        for thread in self._threads: </s> remove     def output_processing(self, faces, size, filename):
        """ Prepare faces for output """
        self.align_face(faces, size, filename)
        self.post_process.do_actions(faces)
 </s> add     def _output_processing(self, faces, size):
        """ Prepare faces for output

        Loads the aligned face, perform any processing actions and verify the output.

        Parameters:
        faces: dict
            Dictionary output from :class:`plugins.extract.Pipeline.Extractor`
        size: int
            The size that the aligned face should be created at
        """
        for face in faces["detected_faces"]:
            face.load_aligned(faces["image"], size=size)

        self._post_process.do_actions(faces) </s> remove                     detected_faces[filename] = faces
 </s> add  </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:
                self._threaded_redirector("reload", detected_faces)
        saver.close()
                  logger.debug("Putting EOF to save")
                  self.save_queue.put("EOF")
              else:
                  logger.debug("Reloading images")
                self._threaded_redirector("reload", detected_faces)
        saver.close()
  
      def check_thread_error(self):
          """ Check and raise thread errors """
          for thread in self.threads:
              thread.check_and_raise_error()
keep keep keep keep 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