MCPcopy Create free account
hub / github.com/NVIDIA/MinkowskiEngine / test_label

Method test_label

tests/python/quantization.py:86–102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

84 self.assertTrue((coords == coords[index[reverse_index]]).all())
85
86 def test_label(self):
87 N = 16575
88
89 coords = (np.random.rand(N, 3) * 100).astype(np.int32)
90 feats = np.random.rand(N, 4)
91 labels = np.floor(np.random.rand(N) * 3)
92
93 labels = labels.astype(np.int32)
94
95 # Make duplicates
96 coords[:3] = 0
97 labels[:3] = 2
98
99 qcoords, qfeats, qlabels, mapping, inverse_mapping = sparse_quantize(
100 coords, feats, labels, return_index=True, return_inverse=True
101 )
102 self.assertTrue(len(mapping) == len(qcoords))
103
104 def test_collision(self):
105 coords = np.array([[0, 0], [0, 0], [0, 0], [0, 1]], dtype=np.int32)

Callers

nothing calls this directly

Calls 1

sparse_quantizeFunction · 0.90

Tested by

no test coverage detected