      """ Object to hold the frames that are to be checked against """
  
      def process_folder(self):
          """ Iterate through the frames dir pulling the base filename """
          iterator = self.process_video if self.vid_cap else self.process_frames
          for item in iterator():
              yield item
  
      def process_frames(self):
          """ Process exported Frames """
 
</s> remove             If frames folder contains a video file return video capture object """
 </s> add             If frames folder contains a video file return imageio reader object """ </s> remove         cap = cv2.VideoCapture(self.args.input_dir)  # pylint: disable=no-member
        i = 0
        while True:
            ret, frame = cap.read()
            if not ret:
                logger.debug("Video terminated")
                break
            i += 1
            # Keep filename format for outputted face
            filename = "{}_{:06d}.png".format(vidname, i)
 </s> add         reader = imageio.get_reader(self.args.input_dir)
        for i, frame in enumerate(reader):
            # Convert to BGR for cv2 compatibility
            frame = frame[:, :, ::-1]
            filename = "{}_{:06d}.png".format(vidname, i + 1) </s> remove         cap.release()
 </s> add         reader.close() </s> remove         if self.vid_cap:
 </s> add         if self.vid_reader is not None: </s> remove         cap = cv2.VideoCapture(self.args.input_dir)  # pylint: disable=no-member
        cap.set(cv2.CAP_PROP_POS_FRAMES, frame_no - 1)  # pylint: disable=no-member
        ret, frame = cap.read()
        if not ret:
            logger.error("Unable to read from %s from video %s", frame_no, self.args.input_dir)
            exit(1)
        cap.release()
 </s> add         reader = imageio.get_reader(self.args.input_dir)
        reader.set_image_index(frame_no - 1)
        frame = reader.get_next_data()[:, :, ::-1]
        reader.close()
        iterator = self.process_video if self.vid_reader is not None else self.process_frames
      """ Object to hold the frames that are to be checked against """
  
      def process_folder(self):
          """ Iterate through the frames dir pulling the base filename """
        iterator = self.process_video if self.vid_reader is not None else self.process_frames
          for item in iterator():
              yield item
  
      def process_frames(self):
          """ Process exported Frames """
keep keep keep keep replace keep keep keep keep keep
 Replace CV2 video loading with ImageIO 
tools/lib_alignments/media.py