ClassificationImageDataset#

class ClassificationImageDataset[source]#

Bases: ImageDataset

Read images and class labels from images stored in class folders.

I.e., all images for a class “A” are stored in directory A/, all images for a class “B” are stored in directory B/, and so on. And all class directories are located in the same parent directory.

__init__(data_dir: str, class_names: Optional[Iterable[str]], *args, **kwargs)[source]#

Constructor.

Parameters:

Methods

__init__(data_dir, class_names, *args, **kwargs)

Constructor.

__add__(other: Dataset[T_co]) ConcatDataset[T_co]#
Parameters:

other (Dataset[T_co]) –

Return type:

ConcatDataset[T_co]

__getitem__(key) tuple[torch.Tensor, torch.Tensor]#
Return type:

tuple[torch.Tensor, torch.Tensor]

__init__(data_dir: str, class_names: Optional[Iterable[str]], *args, **kwargs)[source]#

Constructor.

Parameters: