          return retval
  
      def check_input_folder(self):
          """ makes sure that the frames or faces folder exists
              If frames folder contains a video file return video capture object """
          err = None
          loadtype = self.__class__.__name__
          if not self.folder:
              err = "ERROR: A {} folder must be specified".format(loadtype)
          elif not os.path.exists(self.folder):
 
</s> remove         iterator = self.process_video if self.vid_cap else self.process_frames
 </s> add         iterator = self.process_video if self.vid_reader is not None else self.process_frames </s> remove         if self.vid_cap:
 </s> add         if self.vid_reader is not None: </s> remove             retval = cv2.VideoCapture(self.folder)  # pylint: disable=no-member
 </s> add             retval = imageio.get_reader(self.folder) </s> remove         self.vid_cap = self.check_input_folder()
 </s> add         self.vid_reader = self.check_input_folder() </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)
            If frames folder contains a video file return imageio reader object """
          return retval
  
      def check_input_folder(self):
          """ makes sure that the frames or faces folder exists
            If frames folder contains a video file return imageio reader object """
          err = None
          loadtype = self.__class__.__name__
          if not self.folder:
              err = "ERROR: A {} folder must be specified".format(loadtype)
          elif not os.path.exists(self.folder):
keep keep keep keep replace keep keep keep keep keep
 Replace CV2 video loading with ImageIO 
tools/lib_alignments/media.py