vis4d.data.datasets.base

Base dataset classes.

We implement a typed version of the PyTorch dataset class here. In addition, we provide a number of Mixin classes which a dataset can inherit from to implement additional functionality.

Classes

Dataset([image_channel_mode, data_backend])

Basic pytorch dataset with defined return type.

VideoDataset(*args, **kwargs)

Video datasets.

VideoMapping

Grouped dataset sample indices and frame indices.

class Dataset(image_channel_mode='RGB', data_backend=None)[source]

Basic pytorch dataset with defined return type.

Initialize dataset.

Parameters:
  • image_channel_mode (str) – Image channel mode to use. Default: RGB.

  • data_backend (None | DataBackend) – Data backend to use. Default: None.

__getitem__(idx)[source]

Convert single element at given index into Vis4D data format.

Return type:

Dict[str, Any]

__len__()[source]

Return length of dataset.

Return type:

int

validate_keys(keys_to_load)[source]

Validate that all keys to load are supported.

Parameters:

keys_to_load (list[str]) – List of keys to load.

Raises:

ValueError – Raise if any key is not defined in AVAILABLE_KEYS.

Return type:

None

class VideoDataset(*args, **kwargs)[source]

Video datasets.

Provides video_mapping attribute for video based interface and reference view samplers.

Initialize dataset.

class VideoMapping[source]

Grouped dataset sample indices and frame indices.