kaolin.io.shapenet

API

class kaolin.io.shapenet.ShapeNetV1(root: str, categories: Optional[list] = None, train: bool = True, split: float = 0.7, with_materials=True)

Bases: Generic[torch.utils.data.dataset.T_co]

ShapeNetV1 Dataset class for meshes.

The __getitem__ method will return a KaolinDatasetItem, with its data field containing a kaolin.io.obj.ObjMesh.

Parameters
  • root (str) – path to ShapeNet root directory

  • categories (list) – List of categories to load from ShapeNet. This list may contain synset ids, class label names (for ShapeNetCore classes), or a combination of both. Default: all supported categories.

  • train (bool) – If True, return the training set, otherwise the test set. Default: True.

  • split (float) – fraction of the dataset to be used for training (>=0 and <=1). Default: 0.7

  • with_materials (bool) – If True, load and return materials. Default: True.

SUPPORTED_SYNSETS = {'02691156', '02747177', '02773838', '02801938', '02808440', '02818832', '02828884', '02834778', '02843684', '02858304', '02871439', '02876657', '02880940', '02924116', '02933112', '02942699', '02946921', '02954340', '02958343', '02992529', '03001627', '03046257', '03085013', '03207941', '03211117', '03261776', '03325088', '03337140', '03467517', '03513137', '03593526', '03624134', '03636649', '03642806', '03691459', '03710193', '03759954', '03761084', '03790512', '03797390', '03928116', '03938244', '03948459', '03991062', '04004475', '04074963', '04090263', '04099429', '04225987', '04256520', '04330267', '04379243', '04401088', '04460130', '04468005', '04530566', '04554684'}
get_attributes(index)

Returns the attributes at the given index. Attributes are usually not transformed by wrappers such as ProcessedDataset.

get_cache_key(index)
get_data(index)

Returns the data at the given index.

class kaolin.io.shapenet.ShapeNetV2(root: str, categories: Optional[list] = None, train: bool = True, split: float = 0.7, with_materials=True)

Bases: Generic[torch.utils.data.dataset.T_co]

ShapeNetV2 Dataset class for meshes.

The __getitem__ method will return a KaolinDatasetItem, with its data field containing a kaolin.io.obj.ObjMesh.

Parameters
  • root (str) – path to ShapeNet root directory

  • categories (list) – List of categories to load from ShapeNet. This list may contain synset ids, class label names (for ShapeNetCore classes), or a combination of both. Default: all supported categories.

  • train (bool) – If True, return the training set, otherwise the test set. Default: True.

  • split (float) – fraction of the dataset to be used for training (>=0 and <=1). Default: 0.7

  • with_materials (bool) – If True, load and return materials. Default: True.

SUPPORTED_SYNSETS = {'02691156', '02747177', '02773838', '02801938', '02808440', '02818832', '02828884', '02843684', '02871439', '02876657', '02880940', '02924116', '02933112', '02942699', '02946921', '02954340', '02958343', '02992529', '03001627', '03046257', '03085013', '03207941', '03211117', '03261776', '03325088', '03337140', '03467517', '03513137', '03593526', '03624134', '03636649', '03642806', '03691459', '03710193', '03759954', '03761084', '03790512', '03797390', '03928116', '03938244', '03948459', '03991062', '04004475', '04074963', '04090263', '04099429', '04225987', '04256520', '04330267', '04379243', '04401088', '04460130', '04468005', '04530566', '04554684'}
get_attributes(index)

Returns the attributes at the given index. Attributes are usually not transformed by wrappers such as ProcessedDataset.

get_cache_key(index)
get_data(index)

Returns the data at the given index.