  
      @property
      def count(self):
          """ Number of faces or frames """
          if self.vid_cap:
              retval = int(im_ffm.count_frames_and_secs(self.folder)[0])
          else:
              retval = len(self.file_list_sorted)
          return retval
  
 
</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             retval = cv2.VideoCapture(self.folder)  # pylint: disable=no-member
 </s> add             retval = imageio.get_reader(self.folder) </s> remove         if self.vid_cap:
 </s> add         if self.vid_reader is not None: </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         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 self.vid_reader is not None:
  
      @property
      def count(self):
          """ Number of faces or frames """
        if self.vid_reader is not None:
              retval = int(im_ffm.count_frames_and_secs(self.folder)[0])
          else:
              retval = len(self.file_list_sorted)
          return retval
  
keep keep keep keep replace keep keep keep keep keep
 Replace CV2 video loading with ImageIO 
tools/lib_alignments/media.py