kaolin.datasets.modelnet

class ModelNet(basedir: str, split: Optional[str] = 'train', categories: Optional[Iterable] = ['bed'], transform: Optional[Callable] = None, device: Union[torch.device, str, None] = 'cpu')[source]

Dataset class for the ModelNet dataset.

Parameters
  • basedir (str) – Path to the base directory of the ModelNet dataset.

  • split (str, optional) – Split to load (‘train’ vs ‘test’, default: ‘train’).

  • categories (iterable, optional) – List of categories to load (default: [‘chair’]).

  • transform (callable, optional) – A function/transform to apply on each loaded example.

  • device (str or torch.device, optional) – Device to use (cpu, cuda, cuda:1, etc.). Default: ‘cpu’

Examples

>>> dataset = ModelNet(basedir='data/ModelNet')
>>> train_loader = DataLoader(dataset, batch_size=10, shuffle=True, num_workers=8)
>>> obj, label = next(iter(train_loader))