tlt.datasets.pytorch_dataset.PyTorchDataset¶
- class tlt.datasets.pytorch_dataset.PyTorchDataset(dataset_dir, dataset_name='', dataset_catalog='')[source]¶
Base class to represent a PyTorch Dataset
Methods
__init__(dataset_dir[, dataset_name, ...])Class constructor
get_batch([subset])Get a single batch of images and labels from the dataset.
get_inc_dataloaders()preprocess([image_size, batch_size, add_aug])Preprocess the dataset to resize, normalize, and batch the images.
shuffle_split([train_pct, val_pct, ...])Randomly split the dataset into train, validation, and test subsets with a pseudo-random seed option.
Attributes
data_loaderA data loader object corresponding to the dataset
datasetThe framework dataset object
dataset_catalogThe string name of the dataset catalog (or None)
dataset_dirHost directory containing the dataset files
dataset_nameName of the dataset
test_loaderA data loader object corresponding to the test subset
test_subsetA subset of the dataset held out for final testing/evaluation
train_loaderA data loader object corresponding to the training subset
train_subsetA subset of the dataset used for training
validation_loaderA data loader object corresponding to the validation subset
validation_subsetA subset of the dataset used for validation/evaluation