(sdf_network, sampled_xyz)
| 215 | |
| 216 | @torch.no_grad() |
| 217 | def eval_points(sdf_network, sampled_xyz): |
| 218 | def get_scores_once(sampled_xyz): |
| 219 | sampled_xyz = sampled_xyz.reshape(-1, 3) |
| 220 | |
| 221 | if sampled_xyz.shape[0] == 0: |
| 222 | return |
| 223 | color = sdf_network.get_color(sampled_xyz) |
| 224 | return color.detach().cpu() |
| 225 | |
| 226 | chunk_size = 3200 |
| 227 | |
| 228 | results = [] |
| 229 | for i in range(0, sampled_xyz.size(0), chunk_size): |
| 230 | score_once = get_scores_once(sampled_xyz[i: i + chunk_size].cuda()) |
| 231 | results.append(score_once) |
| 232 | results = torch.cat(results, dim=0) |
| 233 | return results |
| 234 | |
| 235 | |
| 236 | # convert sdf to weight |
no test coverage detected