tlt.datasets.image_classification.tfds_image_classification_dataset.TFDSImageClassificationDataset

class tlt.datasets.image_classification.tfds_image_classification_dataset.TFDSImageClassificationDataset(dataset_dir, dataset_name, split=['train'], as_supervised=True, shuffle_files=True, seed=None, **kwargs)[source]

An image classification dataset from the TensorFlow datasets catalog

__init__(dataset_dir, dataset_name, split=['train'], as_supervised=True, shuffle_files=True, seed=None, **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[, ...])

Preprocess the dataset to convert to float32, resize, 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

dataset

Returns the framework dataset object (tf.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_subset

A subset of the dataset held out for final testing/evaluation

train_subset

A subset of the dataset used for training

validation_subset

A subset of the dataset used for validation/evaluation