(self, video_path, sample_interval=1)
A video reader class for reading video frames from video.
        Arguments:
            video_path
            sample_interval {int}: sample every kth image.
A video reader class for reading video frames from video.
        Arguments:
            video_path
            sample_interval {int}: sample every kth image.
A video reader class for reading video frames from video . Arguments : video_path sample_interval { int } : sample every kth image .
def __init__(self, video_path, sample_interval=1):
        ''' A video reader class for reading video frames from video.
        Arguments:
            video_path
            sample_interval {int}: sample every kth image.
        '''
        if not os.path.exists(video_path):
            raise IOError("Video not exist: " + video_path)
        assert isinstance(sample_interval, int) and sample_interval >= 1
        self.cnt_imgs = 0
        self._is_stoped = False
        self._video = cv2.VideoCapture(video_path)
        ret, image = self._video.read()
        self._next_image = image
        self._sample_interval = sample_interval
        self._fps = self.get_fps()
        if not self._fps >= 0.0001:
            import warnings
            warnings.warn("Invalid fps of video: {}".format(video_path))
def __init__ ( self , video_path , sample_interval = 1 ) : if not os . path . exists ( video_path ) : raise IOError ( "Video not exist: " + video_path ) assert isinstance ( sample_interval , int ) and sample_interval >= 1 self . cnt_imgs = 0 self . _is_stoped = False self . _video = cv2 . VideoCapture ( video_path ) ret , image = self . _video . read ( ) self . _next_image = image self . _sample_interval = sample_interval self . _fps = self . get_fps ( ) if not self . _fps >= 0.0001 : import warnings warnings . warn ( "Invalid fps of video: {}" . format ( video_path ) )