Shortcuts

ConcatDataset

class mmocr.datasets.ConcatDataset(datasets, pipeline=[], verify_meta=True, force_apply=False, lazy_init=False)[源代码]

A wrapper of concatenated dataset.

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

注解

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.

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

  • pipeline (list, optional) – Processing pipeline to be applied to all of the concatenated datasets. Defaults to [].

  • verify_meta (bool) – Whether to verify the consistency of meta information of the concatenated datasets. Defaults to True.

  • force_apply (bool) – Whether to force apply pipeline to all datasets if any of them already has the pipeline configured. Defaults to False.

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