ImageNetC#

class torch_uncertainty.datasets.classification.ImageNetC(**kwargs)[source]#

Initializes the ImageNetC dataset class.

This is a subclass of ImageNetVariation that supports additional keyword arguments.

Parameters:

kwargs

Additional keyword arguments passed to the superclass, including:

  • root: Root directory of the datasets.

  • split: For API consistency. Defaults to None.

  • transform: A function/transform that takes in a PIL image and returns a transformed version. E.g., transforms.RandomCrop. Defaults to None.

  • target_transform: A function/transform that takes in the target and transforms it. Defaults to None.

  • download: If True, downloads the dataset from the internet and puts it in the root directory. If the dataset is already downloaded, it is not downloaded again. Defaults to False.