(file_name, voxel_size)
| 61 | |
| 62 | |
| 63 | def load_file(file_name, voxel_size): |
| 64 | pcd = o3d.io.read_point_cloud(file_name) |
| 65 | coords = torch.from_numpy(np.array(pcd.points)) |
| 66 | feats = torch.from_numpy(np.array(pcd.colors)).float() |
| 67 | |
| 68 | quantized_coords = torch.floor(coords / voxel_size).int() |
| 69 | inds, inverse_inds = quantize(quantized_coords) |
| 70 | |
| 71 | return quantized_coords[inds], feats[inds], pcd |
| 72 | |
| 73 | |
| 74 | def generate_input_sparse_tensor(file_name, voxel_size=0.05, batch_size=1): |
no test coverage detected