          if output.startswith("frame="):
              logger.debug("frame line: %s", output)
              if not init_tqdm:
                  logger.debug("Initializing tqdm")
                  pbar = tqdm(desc="Counting Video Frames", total=duration, unit="secs")
                  init_tqdm = True
              time_idx = output.find("time=") + len("time=")
              frame_idx = output.find("frame=") + len("frame=")
              frames = int(output[frame_idx:].strip().split(" ")[0].strip())
              vid_time = int(convert_to_secs(*output[time_idx:].split(" ")[0].strip().split(":")))
 
</s> remove                 output = os.path.join(self.faces_dir, output)
                f_hash = self.extracted_faces.save_face_with_hash(output,
                                                                  extension,
                                                                  face.aligned_face)
                self.alignments.data[frame_fullname][idx]["hash"] = f_hash
 </s> add                 output = os.path.join(self._faces_dir, output)
                f_hash = self._extracted_faces.save_face_with_hash(output,
                                                                   extension,
                                                                   face.aligned_face)
                self._alignments.data[filename][idx]["hash"] = f_hash </s> remove             if self.arguments.large:
                self.frames.save_image(self.faces_dir, output, face.aligned_face)
 </s> add             if self._arguments.large:
                self._frames.save_image(self._faces_dir, output, face.aligned_face) </s> remove         self.arguments = arguments
        self.alignments = alignments
        self.faces_dir = arguments.faces_dir
        self.frames = Frames(arguments.frames_dir)
        self.extracted_faces = ExtractedFaces(self.frames,
                                              self.alignments,
                                              size=arguments.size,
                                              align_eyes=arguments.align_eyes)
 </s> add         self._arguments = arguments
        self._alignments = alignments
        self._faces_dir = arguments.faces_dir
        self._frames = Frames(arguments.frames_dir)
        self._extracted_faces = ExtractedFaces(self._frames,
                                               self._alignments,
                                               size=arguments.size,
                                               align_eyes=arguments.align_eyes) </s> remove class Extract():
    """ Re-extract faces from source frames based on
        Alignment data """
 </s> add class Extract():  # pylint:disable=too-few-public-methods
    """ Re-extract faces from source frames based on Alignment data

    Parameters
    ----------
    alignments: :class:`tools.lib_alignments.media.AlignmentData`
        The alignments data loaded from an alignments file for this rename job
    arguments: :class:`argparse.Namespace`
        The :mod:`argparse` arguments as passed in from :mod:`tools.py`
    """ </s> remove             sizes = self.extracted_faces.get_roi_size_for_frame(frame)
 </s> add             sizes = self._extracted_faces.get_roi_size_for_frame(frame)
                pbar = tqdm(desc="Counting Video Frames", leave=False, total=duration, unit="secs")
          if output.startswith("frame="):
              logger.debug("frame line: %s", output)
              if not init_tqdm:
                  logger.debug("Initializing tqdm")
                pbar = tqdm(desc="Counting Video Frames", leave=False, total=duration, unit="secs")
                  init_tqdm = True
              time_idx = output.find("time=") + len("time=")
              frame_idx = output.find("frame=") + len("frame=")
              frames = int(output[frame_idx:].strip().split(" ")[0].strip())
              vid_time = int(convert_to_secs(*output[time_idx:].split(" ")[0].strip().split(":")))
keep keep keep keep replace keep keep keep keep keep
 lib.alignments: improve re-extraction speed by 500% 
lib/image.py