datasets.rst 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. .. _datasets:
  2. Datasets
  3. ========
  4. Torchvision provides many built-in datasets in the ``torchvision.datasets``
  5. module, as well as utility classes for building your own datasets.
  6. Built-in datasets
  7. -----------------
  8. All datasets are subclasses of :class:`torch.utils.data.Dataset`
  9. i.e, they have ``__getitem__`` and ``__len__`` methods implemented.
  10. Hence, they can all be passed to a :class:`torch.utils.data.DataLoader`
  11. which can load multiple samples in parallel using ``torch.multiprocessing`` workers.
  12. For example: ::
  13. imagenet_data = torchvision.datasets.ImageNet('path/to/imagenet_root/')
  14. data_loader = torch.utils.data.DataLoader(imagenet_data,
  15. batch_size=4,
  16. shuffle=True,
  17. num_workers=args.nThreads)
  18. .. currentmodule:: torchvision.datasets
  19. All the datasets have almost similar API. They all have two common arguments:
  20. ``transform`` and ``target_transform`` to transform the input and target respectively.
  21. You can also create your own datasets using the provided :ref:`base classes <base_classes_datasets>`.
  22. Image classification
  23. ~~~~~~~~~~~~~~~~~~~~
  24. .. autosummary::
  25. :toctree: generated/
  26. :template: class_dataset.rst
  27. Caltech101
  28. Caltech256
  29. CelebA
  30. CIFAR10
  31. CIFAR100
  32. Country211
  33. DTD
  34. EMNIST
  35. EuroSAT
  36. FakeData
  37. FashionMNIST
  38. FER2013
  39. FGVCAircraft
  40. Flickr8k
  41. Flickr30k
  42. Flowers102
  43. Food101
  44. GTSRB
  45. INaturalist
  46. ImageNet
  47. KMNIST
  48. LFWPeople
  49. LSUN
  50. MNIST
  51. Omniglot
  52. OxfordIIITPet
  53. Places365
  54. PCAM
  55. QMNIST
  56. RenderedSST2
  57. SEMEION
  58. SBU
  59. StanfordCars
  60. STL10
  61. SUN397
  62. SVHN
  63. USPS
  64. Image detection or segmentation
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66. .. autosummary::
  67. :toctree: generated/
  68. :template: class_dataset.rst
  69. CocoDetection
  70. CelebA
  71. Cityscapes
  72. Kitti
  73. OxfordIIITPet
  74. SBDataset
  75. VOCSegmentation
  76. VOCDetection
  77. WIDERFace
  78. Optical Flow
  79. ~~~~~~~~~~~~
  80. .. autosummary::
  81. :toctree: generated/
  82. :template: class_dataset.rst
  83. FlyingChairs
  84. FlyingThings3D
  85. HD1K
  86. KittiFlow
  87. Sintel
  88. Stereo Matching
  89. ~~~~~~~~~~~~~~~
  90. .. autosummary::
  91. :toctree: generated/
  92. :template: class_dataset.rst
  93. CarlaStereo
  94. Kitti2012Stereo
  95. Kitti2015Stereo
  96. CREStereo
  97. FallingThingsStereo
  98. SceneFlowStereo
  99. SintelStereo
  100. InStereo2k
  101. ETH3DStereo
  102. Middlebury2014Stereo
  103. Image pairs
  104. ~~~~~~~~~~~
  105. .. autosummary::
  106. :toctree: generated/
  107. :template: class_dataset.rst
  108. LFWPairs
  109. PhotoTour
  110. Image captioning
  111. ~~~~~~~~~~~~~~~~
  112. .. autosummary::
  113. :toctree: generated/
  114. :template: class_dataset.rst
  115. CocoCaptions
  116. Video classification
  117. ~~~~~~~~~~~~~~~~~~~~
  118. .. autosummary::
  119. :toctree: generated/
  120. :template: class_dataset.rst
  121. HMDB51
  122. Kinetics
  123. UCF101
  124. Video prediction
  125. ~~~~~~~~~~~~~~~~~~~~
  126. .. autosummary::
  127. :toctree: generated/
  128. :template: class_dataset.rst
  129. MovingMNIST
  130. .. _base_classes_datasets:
  131. Base classes for custom datasets
  132. --------------------------------
  133. .. autosummary::
  134. :toctree: generated/
  135. :template: class.rst
  136. DatasetFolder
  137. ImageFolder
  138. VisionDataset
  139. Transforms v2
  140. -------------
  141. .. autosummary::
  142. :toctree: generated/
  143. :template: function.rst
  144. wrap_dataset_for_transforms_v2