data package

Subpackages

Submodules

data.data_loaders module

data.data_loaders.create_test_loader(opts: Namespace) CVNetsDataLoader[source]

Helper function to create and return a dataset loader for test dataset from command-line arguments

data.data_loaders.create_train_val_loader(opts: Namespace) Tuple[CVNetsDataLoader, CVNetsDataLoader | None, Sampler][source]

Helper function to create training and validation data loaders.

Parameters:

opts – Command-line arguments

Returns:

A tuple containing training data loader, (optional) validation data loader, and training data sampler.

data.data_loaders.get_num_data_samples_as_int_or_mapping(dataset: BaseDataset) int | Mapping[str, int][source]

Return the number of samples in the dataset.

The dataset can be a single or composition of multiple datasets (as in multi-task learning). For a single dataset, the number of samples is integer while for multiple datasets, a dictionary is returned with task name and number of samples per task.

Parameters:

dataset – An instance of data.datasets.BaseDataset class

Returns:

An integer for single dataset and mapping for composite datasets.

Module contents