MCPcopy Create free account
hub / github.com/d62lu/3DCTN / _get_item

Method _get_item

data_utils/ModelNetDataLoader.py:115–133  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

113 return len(self.datapath)
114
115 def _get_item(self, index):
116 if self.process_data:
117 point_set, label = self.list_of_points[index], self.list_of_labels[index]
118 else:
119 fn = self.datapath[index]
120 cls = self.classes[self.datapath[index][0]]
121 label = np.array([cls]).astype(np.int32)
122 point_set = np.loadtxt(fn[1], delimiter=',').astype(np.float32)
123
124 if self.uniform:
125 point_set = farthest_point_sample(point_set, self.npoints)
126 else:
127 point_set = point_set[0:self.npoints, :]
128
129 point_set[:, 0:3] = pc_normalize(point_set[:, 0:3])
130 if not self.use_normals:
131 point_set = point_set[:, 0:3]
132
133 return point_set, label[0]
134
135 def __getitem__(self, index):
136 return self._get_item(index)

Callers 1

__getitem__Method · 0.95

Calls 2

farthest_point_sampleFunction · 0.70
pc_normalizeFunction · 0.70

Tested by

no test coverage detected