Skip to content

Instantly share code, notes, and snippets.

@pmeier
Created February 11, 2021 14:05
Show Gist options
  • Save pmeier/14756fe0501287b2974e03ab8d651c10 to your computer and use it in GitHub Desktop.
Save pmeier/14756fe0501287b2974e03ab8d651c10 to your computer and use it in GitHub Desktop.
Availability of (target_)?transform(s)? arguments in torchvision.datasets

This is an overview over the usage of the availability of the transform, target_transform, and transforms arguments for all datasets from torchvision.datasets.

Dataset transform target_transform transforms
Caltech101 x x
Caltech256 x x
CelebA x x
CIFAR10 x x
CIFAR100 x x
Cityscapes x x x
CocoCaptions x x x
CocoDetection x x x
FakeData x x
Flickr8k x x
Flickr30k x x
DatasetFolder x x
ImageFolder x x
HMDB51 x
ImageNet x x
Kinetics400 x
LSUN x x
MNIST x x
FashionMNIST x x
KMNIST x x
EMNIST x x
QMNIST x x
Omniglot x x
Phototour x
Places365 x x
SBDataset x
SBU x x
SEMEION x x
STL10 x x
SVHN x x
UCF101 x
USPS x x
VOCSegmentation x x x
VOCDetection x x x
WIDERFace x x

Most image datasets accept the transform / target_transform pair. There are however some exceptions:

  • Cityscapes, CocoCaptions, CocoDetection, VOCSegmentation, and VOCDetection which additionally accept joint transforms
  • Phototour only accepts a transform
  • SBDataset only accepts joint transforms

The video datasets HMDB51, Kinetics400, and UCF101 uniformly only accept a transform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment