123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- .. _datasets:
- Datasets
- ========
- Torchvision provides many built-in datasets in the ``torchvision.datasets``
- module, as well as utility classes for building your own datasets.
- Built-in datasets
- -----------------
- All datasets are subclasses of :class:`torch.utils.data.Dataset`
- i.e, they have ``__getitem__`` and ``__len__`` methods implemented.
- Hence, they can all be passed to a :class:`torch.utils.data.DataLoader`
- which can load multiple samples in parallel using ``torch.multiprocessing`` workers.
- For example: ::
- imagenet_data = torchvision.datasets.ImageNet('path/to/imagenet_root/')
- data_loader = torch.utils.data.DataLoader(imagenet_data,
- batch_size=4,
- shuffle=True,
- num_workers=args.nThreads)
- .. currentmodule:: torchvision.datasets
- All the datasets have almost similar API. They all have two common arguments:
- ``transform`` and ``target_transform`` to transform the input and target respectively.
- You can also create your own datasets using the provided :ref:`base classes <base_classes_datasets>`.
- Image classification
- ~~~~~~~~~~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- Caltech101
- Caltech256
- CelebA
- CIFAR10
- CIFAR100
- Country211
- DTD
- EMNIST
- EuroSAT
- FakeData
- FashionMNIST
- FER2013
- FGVCAircraft
- Flickr8k
- Flickr30k
- Flowers102
- Food101
- GTSRB
- INaturalist
- ImageNet
- KMNIST
- LFWPeople
- LSUN
- MNIST
- Omniglot
- OxfordIIITPet
- Places365
- PCAM
- QMNIST
- RenderedSST2
- SEMEION
- SBU
- StanfordCars
- STL10
- SUN397
- SVHN
- USPS
- Image detection or segmentation
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- CocoDetection
- CelebA
- Cityscapes
- Kitti
- OxfordIIITPet
- SBDataset
- VOCSegmentation
- VOCDetection
- WIDERFace
- Optical Flow
- ~~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- FlyingChairs
- FlyingThings3D
- HD1K
- KittiFlow
- Sintel
- Stereo Matching
- ~~~~~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- CarlaStereo
- Kitti2012Stereo
- Kitti2015Stereo
- CREStereo
- FallingThingsStereo
- SceneFlowStereo
- SintelStereo
- InStereo2k
- ETH3DStereo
- Middlebury2014Stereo
- Image pairs
- ~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- LFWPairs
- PhotoTour
- Image captioning
- ~~~~~~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- CocoCaptions
- Video classification
- ~~~~~~~~~~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- HMDB51
- Kinetics
- UCF101
- Video prediction
- ~~~~~~~~~~~~~~~~~~~~
- .. autosummary::
- :toctree: generated/
- :template: class_dataset.rst
- MovingMNIST
- .. _base_classes_datasets:
- Base classes for custom datasets
- --------------------------------
- .. autosummary::
- :toctree: generated/
- :template: class.rst
- DatasetFolder
- ImageFolder
- VisionDataset
- Transforms v2
- -------------
- .. autosummary::
- :toctree: generated/
- :template: function.rst
- wrap_dataset_for_transforms_v2
|