TinyImageNet¶
- class probly.datasets.torch.TinyImageNet(root: str | Path, split: str = 'train', transform: Callable[..., Any] | None = None, target_transform: Callable[..., Any] | None = None, *, download: bool = False)[source]¶
Bases:
VisionDatasetA Dataset class for the Tiny ImageNet dataset introduced in [LY15].
Tiny ImageNet is a 200-class subset of ImageNet downsampled to 64x64, holding 500 training and 50 validation images per class, with hard integer labels. The data can be found at https://cs231n.stanford.edu/tiny-imagenet-200.zip and fetched with
download=True(a single ~237 MB zip). Class indices follow the sorted WordNet ids, matchingtorchvision.datasets.ImageFolderandtorchvision.datasets.ImageNet; note that the shippedwnids.txtis unsorted, so this order deliberately differs from that file’s line order. The shippedtestsplit is excluded because its labels were never released.Initialize an instance of the TinyImageNet class.
- Parameters:
root – Root directory containing (or to download into) the
tiny-imagenet-200folder.split – Which split to load; must be one of
TinyImageNet.splits.transform – Optional transform to apply to the image.
target_transform – Optional transform to apply to the integer label.
download – Whether to download the Tiny ImageNet zip from Stanford if missing.
- Raises:
ValueError – If
splitis unknown.RuntimeError – If the data is missing and
downloadis False.
- base_folder = 'tiny-imagenet-200'¶
- filename = 'tiny-imagenet-200.zip'¶
- samples: list[tuple[Path, int]]¶
The
(image path, class index)pairs of the selected split, ordered by path.
- splits: tuple[str, ...] = ('train', 'val')¶
The two labeled splits; the shipped
testsplit has no public labels.
- url = 'https://cs231n.stanford.edu/tiny-imagenet-200.zip'¶
- zip_md5 = '90528d7ca1a48142e341f4ef8d21d0de'¶