ModelNet
ModelNet is a dataset containing 3D grids of voxelized objects.
The objects are available either as 20×20×20 or 32×32×32 voxel grids, and are classified into 10 classes.
A visualization of a single object of every class is available both for the 20×20×20 and the 32×32×32 resolutions.
Each dataset element is a Python dictionary with the following keys:
"grid": atorch.Tensorwith shape[1, 20, 20, 20]or[1, 32, 32, 32]of typetorch.uint8with values 0 or 1 indicating whether the corresponding voxel is empty or occupied by the object,"label": atorch.uint8value of the gold class.
The dataset is split into:
train: 3,718 objects for training;dev: 273 objects for development (validation);test: 908 objects for testing.
npfl138.datasets.modelnet.ModelNet
Source code in npfl138/datasets/modelnet.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
LABEL_NAMES
class-attribute
instance-attribute
LABEL_NAMES: list[str] = [
"bathtub",
"bed",
"chair",
"desk",
"dresser",
"monitor",
"night_stand",
"sofa",
"table",
"toilet",
]
The names of the object classes.
Element
class-attribute
instance-attribute
The type of a single dataset element.
Elements
class-attribute
instance-attribute
The type of the whole dataset.
Dataset
Bases: Dataset
Source code in npfl138/datasets/modelnet.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
__len__
__len__() -> int
Return the number of elements in the dataset.
Source code in npfl138/datasets/modelnet.py
69 70 71 | |
__getitem__
Return the index-th element of the dataset.
Source code in npfl138/datasets/modelnet.py
73 74 75 | |
__init__
__init__(resolution: Literal[20, 32]) -> None
Load the ModelNet dataset, downloading it if necessary.
Parameters:
-
resolution(Literal[20, 32]) –The resolution of the dataset to load.
Source code in npfl138/datasets/modelnet.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
evaluate
staticmethod
Evaluate the predictions labels against the gold dataset.
Returns:
-
accuracy(float) –The average accuracy of the predicted labels.
Source code in npfl138/datasets/modelnet.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
evaluate_file
staticmethod
Evaluate the file with predictions against the gold dataset.
Returns:
-
accuracy(float) –The average accuracy of the predicted labels.
Source code in npfl138/datasets/modelnet.py
119 120 121 122 123 124 125 126 127 | |