(file_name, voxel_size)
| 67 | |
| 68 | |
| 69 | def load_file(file_name, voxel_size): |
| 70 | pcd = o3d.io.read_point_cloud(file_name) |
| 71 | coords = torch.from_numpy(np.array(pcd.points)) |
| 72 | feats = torch.from_numpy(np.array(pcd.colors)).float() |
| 73 | |
| 74 | quantized_coords = torch.floor(coords / voxel_size).int() |
| 75 | inds, inverse_inds = quantize(quantized_coords) |
| 76 | |
| 77 | return quantized_coords[inds], feats[inds], pcd |
| 78 | |
| 79 | |
| 80 | def forward(coords, colors, model): |