                      self._output_faces(saver, faces)
                      if self._save_interval and (idx + 1) % self._save_interval == 0:
                          self._alignments.save()
                  else:
                      del faces["image"]
                      # cache detected faces for next run
                      detected_faces[faces["filename"]] = faces
                  status_bar.update(1)
  
              if not is_final:
                  logger.debug("Reloading images")
                  self._threaded_redirector("reload", detected_faces)
 
</s> remove                 exception = faces.get("exception", False)
                if exception:
                    break

                if self._extractor.final_pass:
                    self._output_processing(faces, size)
                    self._output_faces(saver, faces)
 </s> add                 if is_final:
                    self._output_processing(extract_media, size)
                    self._output_faces(saver, extract_media) </s> remove         faces_count = len(faces["detected_faces"])
 </s> add         faces_count = len(extract_media.detected_faces) </s> remove                            os.path.basename(faces["filename"]))
 </s> add                            os.path.basename(extract_media.filename)) </s> remove         self._post_process.do_actions(faces)
 </s> add         self._post_process.do_actions(extract_media)
        extract_media.remove_image() </s> remove                         self._rollover = {k: v[f_idx + 1:] if k == "detected_faces" else v
                                          for k, v in item.items()}
 </s> add                         self._rollover = ExtractMedia(item.filename, item.image)
                        self._rollover.add_detected_faces(item.detected_faces[f_idx + 1:])
                    extract_media.remove_image()
                    # cache extract_media for next run
                    detected_faces[extract_media.filename] = extract_media
                      self._output_faces(saver, faces)
                      if self._save_interval and (idx + 1) % self._save_interval == 0:
                          self._alignments.save()
                  else:
                    extract_media.remove_image()
                    # cache extract_media for next run
                    detected_faces[extract_media.filename] = extract_media
                    extract_media.remove_image()
                    # cache extract_media for next run
                    detected_faces[extract_media.filename] = extract_media
                    extract_media.remove_image()
                    # cache extract_media for next run
                    detected_faces[extract_media.filename] = extract_media
                  status_bar.update(1)
  
              if not is_final:
                  logger.debug("Reloading images")
                  self._threaded_redirector("reload", detected_faces)
keep keep keep keep replace replace replace keep keep keep keep keep
 plugins.extract - Create ExtractMedia class for pipeline flow
Bugfix - Fix memory leak in extract 
scripts/extract.py