tlt.datasets.image_classification.torchvision_image_classification_dataset.TorchvisionImageClassificationDataset¶
- class tlt.datasets.image_classification.torchvision_image_classification_dataset.TorchvisionImageClassificationDataset(dataset_dir, dataset_name, split=['train'], download=True, num_workers=0, shuffle_files=True, **kwargs)[source]¶
An image classification dataset from the torchvision catalog
- __init__(dataset_dir, dataset_name, split=['train'], download=True, num_workers=0, shuffle_files=True, **kwargs)[source]¶
Class constructor
Methods
__init__
(dataset_dir, dataset_name[, split, ...])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
class_names
Returns the list of class names
data_loader
A data loader object corresponding to the dataset
dataset
Returns the framework dataset object (torch.utils.data.Dataset)
dataset_catalog
The string name of the dataset catalog (or None)
dataset_dir
Host directory containing the dataset files
dataset_name
Name of the dataset
info
Returns a dictionary of information about the dataset
test_loader
A data loader object corresponding to the test subset
test_subset
A subset of the dataset held out for final testing/evaluation
train_loader
A data loader object corresponding to the training subset
train_subset
A subset of the dataset used for training
validation_loader
A data loader object corresponding to the validation subset
validation_subset
A subset of the dataset used for validation/evaluation