dlpy.images.ImageTable.from_table¶
-
classmethod
ImageTable.
from_table
(tbl, image_col='_image_', label_col='_label_', path_col=None, columns=None, casout=None, label_level=0)¶ Create an ImageTable from a CASTable
Parameters: - tbl : CASTable
The CASTable object to use as the source.
- image_col : str, optional
Specifies the column name for the image data. Default = ‘_image_’
- label_col : str, optional
Specifies the column name for the labels. Default = ‘_label_’
- path_col : str, optional
Specifies the column name that stores the path for each image. Default = None, and the unique image ID will be generated from the labels.
- columns : list of str, optional
Specifies the extra columns in the image table. Default = None
- casout : dict
Specifies the output CASTable parameters. Default = None. Note : the options of replace=True, blocksize=32 will be automatically added to the casout option.
- label_level : optional
Specifies which path level should be used to generate the class labels for each image. For instance, label_level = 1 means the first directory and label_level = -2 means the last directory. This internally use the SAS scan function (check https://www.sascrunch.com/scan-function.html for more details). In default, no class labels are generated. If the label column already exists, this option will be ignored.
Default: 0
Returns: Examples
>>> from swat import CAS >>> from dlpy.images import ImageTable >>> s=CAS("cloud.example.com", 5570) >>> s.loadactionset("images") >>> s.images.loadImages(casout="images",path="path/to/images") >>> cas_table = s.CASTable("images") >>> img_table=ImageTable.from_table(cas_table) >>> img_table.show()
For details about the loadImages action, see images.loadImages