vis4d.data.data_pipe¶
DataPipe wraps datasets to share the prepossessing pipeline.
Classes
|
DataPipe class. |
|
MultiSampleDataPipe class. |
- class DataPipe(datasets, preprocess_fn=<function DataPipe.<lambda>>)[source]¶
DataPipe class.
This class wraps one or multiple instances of a PyTorch Dataset so that the preprocessing steps can be shared across those datasets. Composes dataset and the preprocessing pipeline.
Creates an instance of the class.
- Parameters:
- class MultiSampleDataPipe(datasets, preprocess_fn)[source]¶
MultiSampleDataPipe class.
This class wraps DataPipe to support augmentations that require multiple images (e.g., Mosaic and Mixup) by sampling additional indices for each image. NUM_SAMPLES needs to be defined as a class attribute for transforms that require multi-sample augmentation.
Creates an instance of the class.
- Parameters:
datasets (Dataset | Iterable[Dataset]) – Dataset(s) to be wrapped by this data pipeline.
preprocess_fn (list[list[TFunctor]]) – Preprocessing functions of a single sample. Different than DataPipe, this is a list of lists of transformation functions. The inner list is for transforms that needs to share the same sampled indices (e.g., GenMosaicParameters and MosaicImages), and the outer list is for different transforms.