CIFAR100C¶
- class probly.datasets.torch.CIFAR100C(root: str | Path, corruption: str, severity: int, transform: Callable[..., Any] | None = None, target_transform: Callable[..., Any] | None = None, *, download: bool = False)[source]¶
Bases:
CIFAR10CA Dataset class for the CIFAR-100-C corruption benchmark introduced in [HD19].
One instance holds the 10,000 CIFAR-100 test images for a single
corruptiontype at a singleseveritylevel (1-5), with hard integer labels over the 100 fine classes. The release uses the same 19 corruption types and file layout as CIFAR-10-C. The data can be found at https://zenodo.org/records/3555552 and fetched withdownload=True(a single ~2.9 GBCIFAR-100-C.tarthat covers all corruption types).Initialize an instance of the CIFAR100C class.
- Parameters:
root – Root directory containing (or to download into) the
CIFAR-100-Cfolder.corruption – Corruption type; must be one of
CIFAR100C.corruptions.severity – Corruption severity in 1..5.
transform – Optional transform to apply to the image.
target_transform – Optional transform to apply to the integer label.
download – Whether to download the CIFAR-100-C tar from Zenodo if missing.
- Raises:
ValueError – If
corruptionis unknown orseverityis not in 1..5.RuntimeError – If the data is missing and
downloadis False.
- base_folder = 'CIFAR-100-C'¶
- corruptions: tuple[str, ...] = ('gaussian_noise', 'shot_noise', 'impulse_noise', 'defocus_blur', 'glass_blur', 'motion_blur', 'zoom_blur', 'snow', 'frost', 'fog', 'brightness', 'contrast', 'elastic_transform', 'pixelate', 'jpeg_compression', 'speckle_noise', 'gaussian_blur', 'spatter', 'saturate')¶
The 19 corruption types shipped with CIFAR-10-C (15 main + 4 extra).
- filename = 'CIFAR-100-C.tar'¶
- tar_md5 = '11f0ed0f1191edbf9fa23466ae6021d3'¶
- url = 'https://zenodo.org/records/3555552/files/CIFAR-100-C.tar'¶