| 293 | quats = splats["quats"].detach().cpu().numpy() |
| 294 | |
| 295 | def construct_list_of_attributes(splats): |
| 296 | l = ['x', 'y', 'z', 'nx', 'ny', 'nz'] |
| 297 | |
| 298 | for i in range(splats["sh0"].shape[1]*splats["sh0"].shape[2]): |
| 299 | l.append('f_dc_{}'.format(i)) |
| 300 | for i in range(splats["shN"].shape[1]*splats["shN"].shape[2]): |
| 301 | l.append('f_rest_{}'.format(i)) |
| 302 | l.append('opacity') |
| 303 | for i in range(splats["scales"].shape[1]): |
| 304 | l.append('scale_{}'.format(i)) |
| 305 | for i in range(splats["quats"].shape[1]): |
| 306 | l.append('rot_{}'.format(i)) |
| 307 | return l |
| 308 | |
| 309 | dtype_full = [(attribute, 'f4') for attribute in construct_list_of_attributes(splats)] |
| 310 | |