MCPcopy Create free account
hub / github.com/OpenDriveLab/OccNet / custom_build_dataset

Function custom_build_dataset

projects/mmdet3d_plugin/datasets/builder.py:123–146  ·  view source on GitHub ↗
(cfg, default_args=None)

Source from the content-addressed store, hash-verified

121
122
123def custom_build_dataset(cfg, default_args=None):
124 from mmdet3d.datasets.dataset_wrappers import CBGSDataset
125 from mmdet.datasets.dataset_wrappers import (ClassBalancedDataset,
126 ConcatDataset, RepeatDataset)
127 if isinstance(cfg, (list, tuple)):
128 dataset = ConcatDataset([custom_build_dataset(c, default_args) for c in cfg])
129 elif cfg['type'] == 'ConcatDataset':
130 dataset = ConcatDataset(
131 [custom_build_dataset(c, default_args) for c in cfg['datasets']],
132 cfg.get('separate_eval', True))
133 elif cfg['type'] == 'RepeatDataset':
134 dataset = RepeatDataset(
135 custom_build_dataset(cfg['dataset'], default_args), cfg['times'])
136 elif cfg['type'] == 'ClassBalancedDataset':
137 dataset = ClassBalancedDataset(
138 custom_build_dataset(cfg['dataset'], default_args), cfg['oversample_thr'])
139 elif cfg['type'] == 'CBGSDataset':
140 dataset = CBGSDataset(custom_build_dataset(cfg['dataset'], default_args))
141 elif isinstance(cfg.get('ann_file'), (list, tuple)):
142 dataset = _concat_dataset(cfg, default_args)
143 else:
144 dataset = build_from_cfg(cfg, DATASETS, default_args)
145
146 return dataset

Callers 1

custom_train_detectorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected