nip.image_classification.data.TorchVisionDatasetWrapper

nip.image_classification.data.TorchVisionDatasetWrapper#

class nip.image_classification.data.TorchVisionDatasetWrapper(root: str | Path, train: bool = True, transform: callable | None = None, target_transform: callable | None = None, download: bool = False)[source]#

A wrapper for TorchVision datasets, implementing a common interface.

Derived classes should defined the class attributes below.

Class attributes#

data_classtype[VisionDataset]

The TorchVision dataset class.

num_channelsint

The number of channels of the images in the dataset.

widthint

The width of the images in the dataset.

heightint

The height of the images in the dataset.

selected_classestuple[int, int]

When selecting two classes from the original dataset, the default two to select.

binarification_seedint

The seed used when doing a randomised binarification.

Methods Summary

__init__(root[, train, transform, ...])

Attributes

binarification_seed

selected_classes

num_channels

width

height

Methods

__init__(root: str | Path, train: bool = True, transform: callable | None = None, target_transform: callable | None = None, download: bool = False)[source]#