(self)
| 92 | class 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) |
nothing calls this directly
no test coverage detected