kaolin.io.modelnet¶
API¶
- class kaolin.io.modelnet.ModelNet(root, categories=None, split='train', transform=None, output_dict=False)¶
Bases:
Dataset
Dataset class for the ModelNet dataset.
The __getitem__ method will return:
if output_dict=True: a dictionary with the following key-value pairs:
‘mesh’: containing a namedtuple returned by
kaolin.io.off.import_mesh()
.‘name’: the model name (i.e the subfolder name)
‘path’: the full path to the .off
‘label’: the category of the model
if output_dict=False (deprecated): a
KaolinDatasetItem
with the fields:data
: containing a namedtuple returned bykaolin.io.off.import_mesh()
.attributes
: containing a dictionary with the following key-value pairs:‘name’: the model name (i.e the subfolder name)
‘path’: the full path to the .off
‘label’: the category of the model
Deprecated since version 0.13.0: output_dict=False is deprecated. Datasets should always output a dictionary to be compatible with
ProcessedDataset
.- Parameters
root (str) – Path to the base directory of the ModelNet dataset.
categories (list) – List of categories to load. Default: all categories available.
split (str) – Split to load (‘train’ vs ‘test’, default: ‘train’).
transform (Callable) – A function/transform that takes in a dictionary or
KaolinDatasetItem
and returns a transformed version.output_dict (bool) – If True, __getitem__ output a dictionary, else
KaolinDatasetItem
(deprecated) Default: False.
- get_attributes(index)¶
- get_cache_key(index)¶
- get_data(index)¶