py123d_detection.torch.data.datamodule¶
Feeding one or several 123D datasets to a Lightning trainer.
Training concatenates the datasets and shuffles across all of them, so a batch may mix nuScenes and Argoverse frames. Validation keeps them apart, one loader each, because a single averaged number over several datasets hides which one regressed.
The mix is set by how many frames each dataset serves rather than by a sampler: a dataset with
10000 frames next to one with 1000 is drawn from ten times as often. That is the whole mechanism,
and it is worth saying plainly. Set num_frames per dataset to choose the mix directly, or let
sample_rate_hz and the length of the logs decide it.
Each worker reseeds its copy of every dataset’s augmentation generator from the worker’s own seed and the trainer’s rank, so workers and ranks draw different augmentations, every epoch draws new ones, and the same run repeated draws the same ones.
Classes
|
Train on one or more 123D datasets, validate on each separately. |
- class py123d_detection.torch.data.datamodule.Py123DDataModule(train=(), val=(), batch_size=1, num_workers=0, prefetch_factor=4, collate_fn=None)[source]¶
Bases:
LightningDataModuleTrain on one or more 123D datasets, validate on each separately.
- Parameters:
train (
Sequence[Py123DDetectionDataset]) – Datasets to concatenate and shuffle for training.val (
Sequence[Py123DDetectionDataset]) – Datasets to validate on, each getting its own dataloader in the order given.prefetch_factor (
int) – Batches each worker keeps ready. One batch is a rig of decoded images, so this trades host memory for a GPU that never waits. Ignored whennum_workersis 0.collate_fn (
Optional[Callable]) – Defaults tocollate_rigs(), which handles rigs of different sizes.