RepeatDataset¶
- class mmengine.dataset.RepeatDataset(dataset, times, lazy_init=False)[source]¶
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.
Note
RepeatDatasetshould not inherit fromBaseDatasetsinceget_subsetandget_subset_could produce ambiguous meaning sub-dataset which conflicts with original dataset. If you want to use a sub-dataset ofRepeatDataset, you should setindicesarguments for wrapped dataset which inherit fromBaseDataset.- Parameters:
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.
- get_subset(indices)[source]¶
Not supported in
RepeatDatasetfor the ambiguous meaning of sub- dataset.- Parameters:
- Return type: