(self)
return img, img_action_label, img_info
Returns:
            img {RGB image}: 
                Next RGB image from folder. 
            img_action_label {str}: 
                Action label obtained from folder name.
            img_info {list}: 
                Something like [1, 7, 54, "jump", "jump_03-02-12-34-01-795/00240.jpg"]
        Raise:
            RuntimeError, if fail to read next image due to wrong index or wrong filepath.
Returns:
            img {RGB image}: 
                Next RGB image from folder. 
            img_action_label {str}: 
                Action label obtained from folder name.
            img_info {list}: 
                Something like [1, 7, 54, "jump", "jump_03-02-12-34-01-795/00240.jpg"]
        Raise:
            RuntimeError, if fail to read next image due to wrong index or wrong filepath.
Returns : img { RGB image } : Next RGB image from folder . img_action_label { str } : Action label obtained from folder name . img_info { list } : Something like [ 1 7 54 jump jump_03 - 02 - 12 - 34 - 01 - 795 / 00240 . jpg ] Raise : RuntimeError if fail to read next image due to wrong index or wrong filepath .
def read_image(self):
        '''
        Returns:
            img {RGB image}: 
                Next RGB image from folder. 
            img_action_label {str}: 
                Action label obtained from folder name.
            img_info {list}: 
                Something like [1, 7, 54, "jump", "jump_03-02-12-34-01-795/00240.jpg"]
        Raise:
            RuntimeError, if fail to read next image due to wrong index or wrong filepath.
        '''
        self.i += 1
        if self.i > len(self.images_info):
            raise RuntimeError(f"There are only {len(self.images_info)} images, "
                               f"but you try to read the {self.i}th image")
        filepath = self.get_filename(self.i)
        img = self.imread(self.i)
        if img is None:
            raise RuntimeError("The image file doesn't exist: " + filepath)
        img_action_label = self.get_action_label(self.i)
        img_info = self.get_image_info(self.i)
        return img, img_action_label, img_info
def read_image ( self ) : self . i += 1 if self . i > len ( self . images_info ) : raise RuntimeError ( f"There are only {len(self.images_info)} images, " f"but you try to read the {self.i}th image" ) filepath = self . get_filename ( self . i ) img = self . imread ( self . i ) if img is None : raise RuntimeError ( "The image file doesn't exist: " + filepath ) img_action_label = self . get_action_label ( self . i ) img_info = self . get_image_info ( self . i ) return img , img_action_label , img_info