                                total=to_process,
                                file=sys.stdout,
                                desc=desc)
              for idx, faces in enumerate(status_bar):
                  self.check_thread_error()
                  exception = faces.get("exception", False)
                  if exception:
                      break
                  filename = faces["filename"]
  
 
</s> remove                                                       self.extractor.passes,
                                                      self.extractor.phase.title())
            status_bar = tqdm(self.extractor.detected_faces(),
                              total=to_process,
 </s> add                                                       self._extractor.passes,
                                                      self._extractor.phase.title())
            status_bar = tqdm(self._extractor.detected_faces(),
                              total=self._images.process_count, </s> remove                 filename = faces["filename"]
 </s> add  </s> remove             self.extractor.launch()
            self.check_thread_error()
 </s> add             self._extractor.launch()
            self._check_thread_error() </s> remove         for phase in range(self.extractor.passes):
 </s> add         for phase in range(self._extractor.passes): </s> remove                 if self.extractor.final_pass:
                    self.output_processing(faces, size, filename)
                    self.output_faces(filename, faces)
                    if self.save_interval and (idx + 1) % self.save_interval == 0:
                        self.alignments.save()
 </s> add                 if self._extractor.final_pass:
                    self._output_processing(faces, size)
                    self._output_faces(saver, faces)
                    if self._save_interval and (idx + 1) % self._save_interval == 0:
                        self._alignments.save()
                self._check_thread_error()
                                total=to_process,
                                file=sys.stdout,
                                desc=desc)
              for idx, faces in enumerate(status_bar):
                self._check_thread_error()
                  exception = faces.get("exception", False)
                  if exception:
                      break
                  filename = faces["filename"]
  
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