Shortcuts

RepeatDataset

class mmengine.dataset.RepeatDataset(dataset, times, lazy_init=False)[源代码]

A wrapper of repeated dataset.

The length of repeated dataset will be times larger than the original dataset. This is useful when the data loading time is long but the dataset is small. Using RepeatDataset can reduce the data loading time between epochs.

备注

RepeatDataset 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 RepeatDataset, you should set indices arguments for wrapped dataset which inherit from BaseDataset.

参数:
  • dataset (BaseDataset or dict) – The dataset to be repeated.

  • times (int) – Repeat times.

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

full_init()[源代码]

Loop to full_init each dataset.

get_data_info(idx)[源代码]

Get annotation by index.

参数:

idx (int) – Global index of ConcatDataset.

返回:

The idx-th annotation of the datasets.

返回类型:

dict

get_subset(indices)[源代码]

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

参数:

indices (List[int] | int) –

返回类型:

BaseDataset

get_subset_(indices)[源代码]

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

参数:

indices (List[int] | int) –

返回类型:

None

property metainfo: dict

Get the meta information of the repeated dataset.

返回:

The meta information of repeated dataset.

返回类型:

dict

Read the Docs v: latest
Versions
latest
stable
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.