MUAD#

class torch_uncertainty.datasets.MUAD(root, split, version='full', min_depth=None, max_depth=None, target_type='semantic', transforms=None, download=False, use_train_ids=True)[source]#

The MUAD Dataset.

Parameters:
  • root (str | Path) – Root directory of dataset where directory leftImg8bit and leftLabel or leftDepth are located.

  • split (Literal['train', 'val', 'test', 'ood']) – The image split to use, train, val, test or ood.

  • version (Literal['small', 'full']) – The version of the dataset to use, small or full. Defaults to "full".

  • min_depth (float | None) – The maximum depth value to use if target_type is depth. Defaults to None.

  • max_depth (float | None) – The maximum depth value to use if target_type is depth. Defaults to None.

  • target_type (Literal['semantic', 'depth']) – The type of target to use, semantic or depth. Defaults to semantic.

  • transforms (Callable | None) – A function/transform that takes in a tuple of PIL images and returns a transformed version. Defaults to None.

  • download (bool) – If True, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again. Defaults to False.

  • use_train_ids (bool) – If True, uses the train ids instead of the original ids. Defaults to True. Note that this is only used for the semantic target type.

Reference:

https://muad-dataset.github.io

Note

MUAD cannot be used for commercial purposes. Read MUAD’s license carefully before using it and verify that you can comply.

encode_target(target)[source]#

Encode the target tensor to the train ids.

Parameters:

target (torch.Tensor) – Target tensor.

Returns:

Encoded target tensor.

Return type:

torch.Tensor