Shortcuts

ConcatDataset

class mmengine.dataset.ConcatDataset(datasets, lazy_init=False)[source]

A wrapper of concatenated dataset.

Same as torch.utils.data.dataset.ConcatDataset and support lazy_init.

Note

ConcatDataset should not inherit from BaseDataset since get_subset and get_subset_ could produce ambiguous meaning sub-dataset which conflicts with original dataset. If you want to use a sub-dataset of ConcatDataset, you should set indices arguments for wrapped dataset which inherit from BaseDataset.

Parameters
  • datasets (Sequence[BaseDataset] or Sequence[dict]) – A list of datasets which will be concatenated.

  • lazy_init (bool, optional) – Whether to load annotation during instantiation. Defaults to False.

full_init()[source]

Loop to full_init each dataset.

get_data_info(idx)[source]

Get annotation by index.

Parameters

idx (int) – Global index of ConcatDataset.

Returns

The idx-th annotation of the datasets.

Return type

dict

get_subset(indices)[source]

Not supported in ConcatDataset for the ambiguous meaning of sub- dataset.

Parameters

indices (Union[List[int], int]) –

Return type

mmengine.dataset.base_dataset.BaseDataset

get_subset_(indices)[source]

Not supported in ConcatDataset for the ambiguous meaning of sub- dataset.

Parameters

indices (Union[List[int], int]) –

Return type

None

property metainfo: dict

Get the meta information of the first dataset in self.datasets.

Returns

Meta information of first dataset.

Return type

dict

Read the Docs v: v0.2.0
Versions
latest
stable
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.