trw.datasets.cityscapes

Module Contents

Functions

image_to_torch(i)

segmentation_to_torch(i)

load_case(batch, dataset, transform)

create_cityscapes_dataset(batch_size: int = 32, root: Optional[str] = None, transform_train: Optional[List[trw.transforms.Transform]] = None, transform_valid: Optional[List[trw.transforms.Transform]] = None, nb_workers: int = 4, target_type: typing_extensions.Literal[semantic] = 'semantic') → trw.basic_typing.Datasets

Load the cityscapes dataset. This requires to register on their website https://www.cityscapes-dataset.com/

trw.datasets.cityscapes.image_to_torch(i)
trw.datasets.cityscapes.segmentation_to_torch(i)
trw.datasets.cityscapes.load_case(batch, dataset, transform)
trw.datasets.cityscapes.create_cityscapes_dataset(batch_size: int = 32, root: Optional[str] = None, transform_train: Optional[List[trw.transforms.Transform]] = None, transform_valid: Optional[List[trw.transforms.Transform]] = None, nb_workers: int = 4, target_type: typing_extensions.Literal[semantic] = 'semantic') trw.basic_typing.Datasets

Load the cityscapes dataset. This requires to register on their website https://www.cityscapes-dataset.com/ and manually download the dataset.

The dataset is composed of 3 parts: gtCoarse, gtFine, leftImg8bit. Download each package and unzip in a folder (e.g., cityscapes)

Parameters
  • batch_size

  • root – the folder containing the 3 unzipped cityscapes data gtCoarse, gtFine, leftImg8bit

  • transform_train – the transform to apply on the training batches

  • transform_valid – the transform to apply on the validation batches

  • nb_workers – the number of workers for each split allocated to the data loading and processing

  • target_type – the segmentation task

Returns

a dict of splits. Each split is a trw.train.Sequence