Dataloader Builder

dataloader.build.build_dataloader(cfg) DataLoader

Build and return a PyTorch DataLoader object.

Parameters:

cfg (dict) – Configuration dictionary containing the following keys: - “dataset”: The dataset to be used for building the DataLoader. - “batch_size”: The batch size for the DataLoader. - “shuffle”: Whether to shuffle the data in the DataLoader.

Returns:

The built DataLoader object.

Return type:

DataLoader

dataloader.build.build_dataset(cfg) CustomDataset

Build a custom dataset based on the provided configuration.

Parameters:

cfg (dict) – The configuration dictionary containing the following keys: - data_dir (str): The directory path where the data is stored. - transform (dict): The configuration for data transformation.

Returns:

The custom dataset object.

Return type:

CustomDataset

dataloader.build.build_transform(cfg) Compose

Build a transformation pipeline based on the provided configuration.

Parameters:

cfg (dict) – A dictionary containing the configuration for the transformations.

Returns:

A composition of transformations.

Return type:

Compose

Raises:

ValueError – If a transform specified in the configuration is not supported.