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 fromBaseDataset
sinceget_subset
andget_subset_
could produce ambiguous meaning sub-dataset which conflicts with original dataset. If you want to use a sub-dataset ofConcatDataset
, you should setindices
arguments for wrapped dataset which inherit fromBaseDataset
.- 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.
- get_subset(indices)[source]¶
Not supported in
ConcatDataset
for the ambiguous meaning of sub- dataset.- Parameters
- Return type