DefaultDataset#
- class DefaultDataset(split='train', data_root='data/dataset', transform=None, test_mode=False, test_cfg=None, cache=False, ignore_index=-1, loop=1)[source]#
Bases:
DatasetGeneric point-cloud dataset over preprocessed per-event
.npyassets.Reads one directory per event, loading every
<asset>.npywhose stem is inVALID_ASSETS(coord,color,normal,strength,segment,instance,pose). Each item is a flatdictkeyed by asset name and always carriescoord,segment,instance,name, andsplit; missingsegment/instancelabels are filled with-1arrays (theignore_indexconvention). After collation a batch adds theoffsetkey delimiting per-sample point spans. Registered asDefaultDataset– use astypeunderdata.train/data.val/data.test.- Parameters:
split (str | Sequence[str]) – Split name(s). A name is treated as a JSON split file under
data_rootif such a file exists, otherwise as a subdirectory whose children are event directories. Defaults to"train".data_root (str) – Root directory holding the split files/subdirectories. Defaults to
"data/dataset".transform (list[dict]) – List of transform configs (NOT a prebuilt
Compose); assembled internally. Defaults toNone.test_mode (bool) – When
True, emit voxelized/augmented test fragments instead of a single transformed sample, and forceloop = 1. Defaults toFalse.test_cfg (object) – Test-time config providing
voxelize,crop,post_transform, andaug_transform. Required whentest_modeisTrue. Defaults toNone.cache (bool) – When
True, read each event from a shared-memory cache keyed by sample name instead of from disk. Defaults toFalse.ignore_index (int) – Label value for ignored/unlabelled points. Defaults to
-1.loop (int) – Train-time epoch multiplier applied to the sample count (forced to
1in test mode). Defaults to1.
Note
Loader settings (
batch_size,num_worker) live at the top level of the config, not on the dataset constructor.Example
>>> from pimm.datasets.builder import build_dataset >>> ds = build_dataset(dict(type="DefaultDataset", split="train", ... data_root="data/dataset", transform=[])) >>> sample = ds[0] >>> # get_data always returns these keys (coord/segment/instance, >>> # with segment/instance filled to -1 when absent on disk): >>> # coord (N, 3), segment (N,), instance (N,), name, split >>> # plus any present optional assets: color, normal, strength, pose >>> sorted(sample) ['coord', 'instance', 'name', 'segment', 'split']
- VALID_ASSETS = ['coord', 'color', 'normal', 'strength', 'segment', 'instance', 'pose']#