bob.med.tb.data.utils

Common utilities

Classes

SampleListDataset(samples[, transforms])

PyTorch dataset wrapper around Sample lists

class bob.med.tb.data.utils.SampleListDataset(samples, transforms=[])[source]

Bases: Generic[torch.utils.data.dataset.T_co]

PyTorch dataset wrapper around Sample lists

A transform object can be passed that will be applied to the image, ground truth and mask (if present).

It supports indexing such that dataset[i] can be used to get ith sample.

Parameters
property transforms
copy(transforms=None)[source]

Returns a deep copy of itself, optionally resetting transforms

Parameters

transforms (list, Optional) – An optional list of transforms to set in the copy. If not specified, use self.transforms.

random_permute(feature)[source]

Randomly permute feature values from all samples

Useful for permutation feature importance computation

Parameters

feature (int) – The position of the feature