ImgsDataset

class jlpy.pytorch.vision.image_classification.lions_cheetahs.ImgsDataset

Bases: Dataset[tuple[FloatTensor, list[int]]]

A custom subclass of Dataset for loading the images.

Methods

__init__

ImgsDataset constractor.

batch_demo

Print demo batch info from the Dataloader.

samp_demo

Print five demo samples from the ImgsDataset.

__init__() None

ImgsDataset constractor.

__getitem__(idx: int) tuple[FloatTensor, list[int]]

Get one element of the dataset.

Parameters:

idx – Index of the element in the dataset.

Returns:

One element of the dataset with a format (tensor, label).

Return type:

tuple[tensor, int]

samp_demo() None

Print five demo samples from the ImgsDataset.

Optional method for testing purposes.

batch_demo() None

Print demo batch info from the Dataloader.

Optional method for testing purposes.