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

Method setUp

tests/python/summary.py:94–110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

92class TestSummary(unittest.TestCase):
93
94 def setUp(self):
95 file_name, voxel_size = "1.ply", 0.02
96 self.device = "cuda" if torch.cuda.is_available() else "cpu"
97 self.net = StackUNet(3, 20, D=3).to(self.device)
98 if not os.path.isfile(file_name):
99 print('Downloading an example pointcloud...')
100 urlretrieve("https://bit.ly/3c2iLhg", file_name)
101
102 pcd = o3d.io.read_point_cloud(file_name)
103 coords = np.array(pcd.points)
104 colors = np.array(pcd.colors)
105
106 self.sinput = SparseTensor(
107 features=torch.from_numpy(colors).float(),
108 coordinates=batched_coordinates([coords / voxel_size], dtype=torch.float32),
109 device=self.device,
110 )
111
112 def test(self):
113 summary(self.net, self.sinput)

Callers

nothing calls this directly

Calls 4

SparseTensorClass · 0.90
batched_coordinatesFunction · 0.90
floatMethod · 0.80
StackUNetClass · 0.70

Tested by

no test coverage detected