ConcatDataset¶
- class mmengine.dataset.ConcatDataset(datasets, lazy_init=False, ignore_keys=None)[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.
ignore_keys (List[str] or str) – Ignore the keys that can be unequal in dataset.metainfo. Defaults to None. New in version 0.3.0.
- get_subset(indices)[source]¶
Not supported in
ConcatDataset
for the ambiguous meaning of sub- dataset.- Parameters
- Return type