<!-- # hard line break macro for HTML -->

# fiftyone.zoo.datasets.torch

FiftyOne Zoo Datasets provided by `torchvision:torchvision.datasets`.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Classes:**

| [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)()               | Base class for zoo datasets that are provided via the `torchvision:torchvision.datasets` package.                            |
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| [`MNISTDataset`](#fiftyone.zoo.datasets.torch.MNISTDataset)()                           | The MNIST database of handwritten digits.                                                                                    |
| [`FashionMNISTDataset`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset)()             | The Fashion-MNIST database of Zalando's fashion article images.                                                              |
| [`CIFAR10Dataset`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset)()                       | The CIFAR-10 dataset consists of 60,000 32 x 32 color images in 10 classes, with 6,000 images per class.                     |
| [`CIFAR100Dataset`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset)()                     | The CIFAR-100 dataset of images.                                                                                             |
| [`ImageNet2012Dataset`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset)([source_dir]) | The ImageNet 2012 dataset.                                                                                                   |
| [`VOC2007Dataset`](#fiftyone.zoo.datasets.torch.VOC2007Dataset)()                       | The dataset for the PASCAL Visual Object Classes Challenge 2007 (VOC2007) for the classification and detection competitions. |
| [`VOC2012Dataset`](#fiftyone.zoo.datasets.torch.VOC2012Dataset)()                       | The dataset for the PASCAL Visual Object Classes Challenge 2012 (VOC2012) for the Classification and Detection competitions. |

### *class* fiftyone.zoo.datasets.torch.TorchVisionDataset

Bases: [`ZooDataset`](fiftyone.zoo.datasets.md#fiftyone.zoo.datasets.ZooDataset)

Base class for zoo datasets that are provided via the
`torchvision:torchvision.datasets` package.

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

**Attributes:**

| [`has_patches`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`has_splits`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`license`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`name`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.name)                                             | The name of the dataset.                                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |
| [`tags`](#fiftyone.zoo.datasets.torch.TorchVisionDataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* name

The name of the dataset.

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.

#### *property* tags

A tuple of tags for the dataset.

### *class* fiftyone.zoo.datasets.torch.MNISTDataset

Bases: [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)

The MNIST database of handwritten digits.

The dataset consists of 70,000 28 x 28 grayscale images in 10 classes.
There are 60,000 training images and 10,000 test images.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("mnist", split="test")

session = fo.launch_app(dataset)
```

Dataset size
: 21.00 MB

Source
: [http://yann.lecun.com/exdb/mnist](http://yann.lecun.com/exdb/mnist)

**Attributes:**

| [`name`](#fiftyone.zoo.datasets.torch.MNISTDataset.name)                                             | The name of the dataset.                                                                                                                                                              |
|------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`license`](#fiftyone.zoo.datasets.torch.MNISTDataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`tags`](#fiftyone.zoo.datasets.torch.MNISTDataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.MNISTDataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`has_patches`](#fiftyone.zoo.datasets.torch.MNISTDataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
| [`has_splits`](#fiftyone.zoo.datasets.torch.MNISTDataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.MNISTDataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.MNISTDataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.MNISTDataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.MNISTDataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.MNISTDataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.MNISTDataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.MNISTDataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.MNISTDataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.MNISTDataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.MNISTDataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.MNISTDataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.MNISTDataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.MNISTDataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

#### *property* name

The name of the dataset.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *property* tags

A tuple of tags for the dataset.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.

### *class* fiftyone.zoo.datasets.torch.FashionMNISTDataset

Bases: [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)

The Fashion-MNIST database of Zalando’s fashion article images.

The dataset consists of 70,000 28 x 28 grayscale images in 10 classes.
There are 60,000 training images and 10,000 test images.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("fashion-mnist", split="test")

session = fo.launch_app(dataset)
```

Dataset size
: 36.42 MB

Source
: [https://github.com/zalandoresearch/fashion-mnist](https://github.com/zalandoresearch/fashion-mnist)

**Attributes:**

| [`name`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.name)                                             | The name of the dataset.                                                                                                                                                              |
|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`license`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`tags`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`has_patches`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
| [`has_splits`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.FashionMNISTDataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

#### *property* name

The name of the dataset.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *property* tags

A tuple of tags for the dataset.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.

### *class* fiftyone.zoo.datasets.torch.CIFAR10Dataset

Bases: [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)

The CIFAR-10 dataset consists of 60,000 32 x 32 color images in 10
classes, with 6,000 images per class. There are 50,000 training images and
10,000 test images.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("cifar10", split="test")

session = fo.launch_app(dataset)
```

Dataset size
: 132.40 MB

Source
: [https://www.cs.toronto.edu/~kriz/cifar.html](https://www.cs.toronto.edu/~kriz/cifar.html)

**Attributes:**

| [`name`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.name)                                             | The name of the dataset.                                                                                                                                                              |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`license`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`tags`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`has_patches`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
| [`has_splits`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.CIFAR10Dataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

#### *property* name

The name of the dataset.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *property* tags

A tuple of tags for the dataset.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.

### *class* fiftyone.zoo.datasets.torch.CIFAR100Dataset

Bases: [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)

The CIFAR-100 dataset of images.

The dataset consists of 60,000 32 x 32 color images in 100 classes, with
600 images per class. There are 50,000 training images and 10,000 test
images.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("cifar100", split="test")

session = fo.launch_app(dataset)
```

Dataset size
: 132.03 MB

Source
: [https://www.cs.toronto.edu/~kriz/cifar.html](https://www.cs.toronto.edu/~kriz/cifar.html)

**Attributes:**

| [`name`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.name)                                             | The name of the dataset.                                                                                                                                                              |
|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`license`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`tags`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`has_patches`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
| [`has_splits`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.CIFAR100Dataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

#### *property* name

The name of the dataset.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *property* tags

A tuple of tags for the dataset.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.

### *class* fiftyone.zoo.datasets.torch.ImageNet2012Dataset(source_dir=None)

Bases: [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)

The ImageNet 2012 dataset.

ImageNet, as known as ILSVRC 2012, is an image dataset organized according
to the WordNet hierarchy. Each meaningful concept in WordNet, possibly
described by multiple words or word phrases, is called a “synonym set” or
“synset”. There are more than 100,000 synsets in WordNet, majority of them
are nouns (80,000+). ImageNet provides on average 1,000 images to
illustrate each synset. Images of each concept are quality-controlled and
human-annotated. In its completion, we hope ImageNet will offer tens of
millions of cleanly sorted images for most of the concepts in the WordNet
hierarchy.

Note that labels were never publicly released for the test set, so only the
training and validation sets are provided.

In order to load the ImageNet dataset, you must download the source data
manually. The directory should be organized in the following format:

```default
source_dir/
    ILSVRC2012_devkit_t12.tar.gz    # both splits
    ILSVRC2012_img_train.tar        # train split
    ILSVRC2012_img_val.tar          # validation split
```

You can register at [http://www.image-net.org/download-images](http://www.image-net.org/download-images) in order to
get links to download the data.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

# The path to the source files that you manually downloaded
source_dir = "/path/to/dir-with-imagenet-files"

dataset = foz.load_zoo_dataset(
    "imagenet-2012",
    split="validation",
    source_dir=source_dir,
)

session = fo.launch_app(dataset)
```

Dataset size
: 144.02 GB

Source
: [http://image-net.org](http://image-net.org)

* **Parameters:**
  **source_dir** (*None*) – the directory containing the manually downloaded
  ImageNet files

**Attributes:**

| [`name`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.name)                                             | The name of the dataset.                                                                                                                                                              |
|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`license`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`tags`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`has_patches`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
| [`has_splits`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.ImageNet2012Dataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

#### *property* name

The name of the dataset.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *property* tags

A tuple of tags for the dataset.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.

### *class* fiftyone.zoo.datasets.torch.VOC2007Dataset

Bases: [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)

The dataset for the PASCAL Visual Object Classes Challenge 2007
(VOC2007) for the classification and detection competitions.

A total of 9,963 images are included in this dataset, where each image
contains a set of objects, out of 20 different classes, making a total of
24,640 annotated objects. In the classification competition, the goal is to
predict the set of labels contained in the image, while in the detection
competition the goal is to predict the bounding box and label of each
individual object.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("voc-2007", split="validation")

session = fo.launch_app(dataset)
```

Dataset size
: 868.85 MB

Source
: [http://host.robots.ox.ac.uk/pascal/VOC/voc2007](http://host.robots.ox.ac.uk/pascal/VOC/voc2007)

**Attributes:**

| [`name`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.name)                                             | The name of the dataset.                                                                                                                                                              |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`license`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`tags`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`has_patches`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
| [`has_splits`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.VOC2007Dataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

#### *property* name

The name of the dataset.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *property* tags

A tuple of tags for the dataset.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.

### *class* fiftyone.zoo.datasets.torch.VOC2012Dataset

Bases: [`TorchVisionDataset`](#fiftyone.zoo.datasets.torch.TorchVisionDataset)

The dataset for the PASCAL Visual Object Classes Challenge 2012
(VOC2012) for the Classification and Detection competitions.

A total of 11,540 images are included in this dataset, where each image
contains a set of objects, out of 20 different classes, making a total of
27,450 annotated objects. In the classification competition, the goal is to
predict the set of labels contained in the image, while in the detection
competition the goal is to predict the bounding box and label of each
individual object.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("voc-2012", split="validation")

session = fo.launch_app(dataset)
```

Dataset size
: 3.59 GB

Source
: [http://host.robots.ox.ac.uk/pascal/VOC/voc2012](http://host.robots.ox.ac.uk/pascal/VOC/voc2012)

**Attributes:**

| [`name`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.name)                                             | The name of the dataset.                                                                                                                                                              |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`license`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.license)                                       | The license or list,of,licenses under which the dataset is distributed, or None if unknown.                                                                                           |
| [`tags`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.tags)                                             | A tuple of tags for the dataset.                                                                                                                                                      |
| [`supported_splits`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.supported_splits)                     | A tuple of supported splits for the dataset, or None if the dataset does not have splits.                                                                                             |
| [`has_patches`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.has_patches)                               | Whether the dataset has patches that may need to be applied to already downloaded files.                                                                                              |
| [`has_splits`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.has_splits)                                 | Whether the dataset has splits.                                                                                                                                                       |
| [`has_tags`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.has_tags)                                     | Whether the dataset has tags.                                                                                                                                                         |
| [`importer_kwargs`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.importer_kwargs)                       | A dict of default kwargs to pass to this dataset's [`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter). |
| [`is_remote`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.is_remote)                                   | Whether the dataset is remotely-sourced.                                                                                                                                              |
| [`parameters`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.parameters)                                 | An optional dict of parameters describing the configuration of the zoo dataset when it was downloaded.                                                                                |
| [`requires_manual_download`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.requires_manual_download)     | Whether this dataset requires some files to be manually downloaded by the user before the dataset can be loaded.                                                                      |
| [`supports_partial_downloads`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.supports_partial_downloads) | Whether the dataset supports downloading partial subsets of its splits.                                                                                                               |

**Methods:**

| [`download_and_prepare`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.download_and_prepare)(dataset_dir[, split, ...])   | Downloads the dataset and prepares it for use.               |
|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [`get_info_path`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.get_info_path)(dataset_dir)                               | Returns the path to the `ZooDatasetInfo` for the dataset.    |
| [`get_split_dir`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.get_split_dir)(dataset_dir, split)                        | Returns the directory for the given split of the dataset.    |
| [`has_info`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.has_info)(dataset_dir)                                         | Determines whether the directory contains `ZooDatasetInfo`.  |
| [`has_split`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.has_split)(split)                                             | Whether the dataset has the given split.                     |
| [`has_tag`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.has_tag)(tag)                                                   | Whether the dataset has the given tag.                       |
| [`load_info`](#fiftyone.zoo.datasets.torch.VOC2012Dataset.load_info)(dataset_dir[, upgrade, ...])                       | Loads the `ZooDatasetInfo` from the given dataset directory. |

#### *property* name

The name of the dataset.

#### *property* license

The license or list,of,licenses under which the dataset is
distributed, or None if unknown.

#### *property* tags

A tuple of tags for the dataset.

#### *property* supported_splits

A tuple of supported splits for the dataset, or None if the dataset
does not have splits.

#### download_and_prepare(dataset_dir, split=None, splits=None, cleanup=True)

Downloads the dataset and prepares it for use.

If the requested splits have already been downloaded, they are not
re-downloaded.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **split** (*None*) – `split` nor `splits` are provided, the full dataset is
    downloaded
  * **splits** (*None*) – a list of splits to download, if applicable. If
    neither `split` nor `splits` are provided, the full dataset
    is  downloaded
  * **cleanup** (*True*) – whether to cleanup any temporary files generated
    during download
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *static* get_info_path(dataset_dir)

Returns the path to the `ZooDatasetInfo` for the dataset.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  the path to the `ZooDatasetInfo`

#### get_split_dir(dataset_dir, split)

Returns the directory for the given split of the dataset.

* **Parameters:**
  * **dataset_dir** – the dataset directory
  * **split** – the dataset split
* **Returns:**
  the directory that will/does hold the specified split

#### *static* has_info(dataset_dir)

Determines whether the directory contains `ZooDatasetInfo`.

* **Parameters:**
  **dataset_dir** – the dataset directory
* **Returns:**
  True/False

#### *property* has_patches

Whether the dataset has patches that may need to be applied to
already downloaded files.

#### has_split(split)

Whether the dataset has the given split.

* **Parameters:**
  **split** – the dataset split
* **Returns:**
  True/False

#### *property* has_splits

Whether the dataset has splits.

#### has_tag(tag)

Whether the dataset has the given tag.

* **Parameters:**
  **tag** – the tag
* **Returns:**
  True/False

#### *property* has_tags

Whether the dataset has tags.

#### *property* importer_kwargs

A dict of default kwargs to pass to this dataset’s
[`fiftyone.utils.data.importers.DatasetImporter`](fiftyone.utils.data.importers.md#fiftyone.utils.data.importers.DatasetImporter).

#### *property* is_remote

Whether the dataset is remotely-sourced.

#### *static* load_info(dataset_dir, upgrade=True, warn_deprecated=False)

Loads the `ZooDatasetInfo` from the given dataset directory.

* **Parameters:**
  * **dataset_dir** – the directory in which to construct the dataset
  * **upgrade** (*True*) – whether to upgrade the JSON file on disk if any
    migrations were necessary
  * **warn_deprecated** (*False*) – whether to issue a warning if the dataset
    has a deprecated format
* **Returns:**
  the `ZooDatasetInfo` for the dataset

#### *property* parameters

An optional dict of parameters describing the configuration of the
zoo dataset when it was downloaded.

#### *property* requires_manual_download

Whether this dataset requires some files to be manually downloaded
by the user before the dataset can be loaded.

#### *property* supports_partial_downloads

Whether the dataset supports downloading partial subsets of its
splits.
