cloudViewer.ml.torch.dataloaders.TorchDataloader#

class cloudViewer.ml.torch.dataloaders.TorchDataloader(dataset=None, preprocess=None, transform=None, sampler=None, use_cache=True, steps_per_epoch=None, **kwargs)[source]#

This class allows you to load datasets for a PyTorch framework.

Example

This example loads the SemanticKITTI dataset using the Torch dataloader:

import torch from torch.utils.data import Dataset, DataLoader train_split = TorchDataloader(dataset=dataset.get_split(‘training’))

__getitem__(index)[source]#

Returns the item at index position (idx).

__init__(dataset=None, preprocess=None, transform=None, sampler=None, use_cache=True, steps_per_epoch=None, **kwargs)[source]#

Initialize.

Parameters:
  • dataset – The 3D ML dataset class. You can use the base dataset, sample datasets , or a custom dataset.

  • preprocess – The model’s preprocess method.

  • transform – The model’s transform method.

  • use_cache – Indicates if preprocessed data should be cached.

  • steps_per_epoch – The number of steps per epoch that indicates the bactches of samples to train. If it is None, then the step number will be the number of samples in the data.

Returns:

The corresponding class.

Return type:

class

__len__()[source]#

Returns the number of steps for an epoch.