ModelNet
npfl138.datasets.modelnet.ModelNet
Source code in npfl138/datasets/modelnet.py
25 26 27 28 29 30 31 32 33 34 35 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 |
|
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
Element = TypedDict('Element', {'grid': ndarray, 'label': ndarray})
The type of a single dataset element.
Elements
class-attribute
instance-attribute
Elements = TypedDict('Elements', {'grids': ndarray, 'labels': ndarray})
The type of the whole dataset.
Dataset
Bases: Dataset
Source code in npfl138/datasets/modelnet.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__len__
__len__() -> int
Return the number of elements in the dataset.
Source code in npfl138/datasets/modelnet.py
58 59 60 |
|
__getitem__
Return the index
-th element of the dataset.
Source code in npfl138/datasets/modelnet.py
62 63 64 |
|
__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
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
D
instance-attribute
D: int = resolution
The depth of the 3D grid, set in the constructor to 20 or 32.
H
instance-attribute
H: int = resolution
The depth of the 3D grid, set in the constructor to 20 or 32.
W
instance-attribute
W: int = resolution
The depth of the 3D grid, set in the constructor to 20 or 32.
evaluate
staticmethod
Evaluate the predictions
against the gold dataset.
Returns:
-
accuracy
(float
) –The accuracy of the predictions in percentages.
Source code in npfl138/datasets/modelnet.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
evaluate_file
staticmethod
Evaluate the file with predictions against the gold dataset.
Returns:
-
accuracy
(float
) –The accuracy of the predictions in percentages.
Source code in npfl138/datasets/modelnet.py
112 113 114 115 116 117 118 119 120 |
|