vis4d.zoo.base.datasets.shift.common

SHIFT data loading config for data augmentation.

Functions

get_shift_config([data_root, train_split, ...])

Get the default config for BDD100K segmentation.

get_shift_dataloader_config(...[, ...])

Get the default config for BDD100K segmentation.

get_test_preprocessing([image_size, ...])

Get the default data preprocessing for SHIFT dataset.

get_train_preprocessing([image_size, ...])

Get the default data preprocessing for SHIFT dataset.

get_shift_config(data_root='data/shift/images', train_split='train', train_framerate='images', train_shift_type='discrete', train_views_to_load=('front',), train_keys_to_load=('images', 'seg_masks'), train_attributes_to_load=None, train_skip_empty_frames=False, test_split='val', test_framerate='images', test_shift_type='discrete', test_views_to_load=('front',), test_keys_to_load=('images', 'seg_masks'), test_attributes_to_load=None, test_skip_empty_frames=False, data_backend=None, image_size=(800, 1280), crop_size=None, horizontal_flip_prob=0.5, color_jitter_prob=0.0, samples_per_gpu=2, workers_per_gpu=2)[source]

Get the default config for BDD100K segmentation.

Return type:

ConfigDict

get_shift_dataloader_config(train_dataset_cfg, test_dataset_cfg, keys_to_load=('images', 'seg_masks'), image_size=(800, 1280), crop_size=None, horizontal_flip_prob=0.5, color_jitter_prob=0.5, samples_per_gpu=2, workers_per_gpu=2, train_views_to_load=('front',), test_views_to_load=('front',))[source]

Get the default config for BDD100K segmentation.

Return type:

ConfigDict

get_test_preprocessing(image_size=(800, 1280), keys_to_load=('images', 'seg_masks'), views_to_load=('front',))[source]

Get the default data preprocessing for SHIFT dataset.

Parameters:
  • image_size (tuple[int, int]) – The image size to resize to. Defaults to (800, 1280).

  • keys_to_load (Sequence[str]) – The keys to load from the dataset. Defaults to (K.images, K.seg_masks).

  • views_to_load (Sequence[str]) – The views to load from the dataset. Defaults to (“front”,).

Return type:

ConfigDict

Returns:

The data preprocessing config.

get_train_preprocessing(image_size=(800, 1280), crop_size=None, horizontal_flip_prob=0.5, color_jitter_prob=0.0, keys_to_load=('images', 'seg_masks'), views_to_load=('front',))[source]

Get the default data preprocessing for SHIFT dataset.

Parameters:
  • image_size (tuple[int, int]) – The image size to resize to. Defaults to (800, 1280).

  • crop_size (Optional[tuple[int, int]]) – The crop size to crop to randomly, if not None. Defaults to None. This step is applied after the resize step.

  • horizontal_flip_prob (float) – The probability of horizontal flipping. Defaults to 0.5.

  • color_jitter_prob (float) – The probability of color jittering. Defaults to 0.5.

  • keys_to_load (Sequence[str]) – The keys to load from the dataset. Defaults to (K.images, K.seg_masks).

  • views_to_load (Sequence[str]) – The views to load from the dataset. Defaults to (“front”,).

Return type:

ConfigDict

Returns:

The data preprocessing config.