(path, white_background, eval)
| 353 | return cam_infos, smplx_vertices |
| 354 | |
| 355 | def readDNARenderingInfo(path, white_background, eval): |
| 356 | |
| 357 | test_view_arr = [3, 5, 7, 8, 11, 15, 17, 19, 21, 23, 27, 29, 31, 33, 35, 39, 41, 45] |
| 358 | train_view_arr = [x for x in range(48) if x not in test_view_arr] |
| 359 | train_info_dict = { |
| 360 | "views": train_view_arr, |
| 361 | "frame_idx": 1, |
| 362 | } |
| 363 | test_info_dict = { |
| 364 | "views": test_view_arr, |
| 365 | "frame_idx": 1, |
| 366 | } |
| 367 | print("Reading Training Transforms", flush=True) |
| 368 | train_cam_infos, smplx_vertices = readCamerasDNARendering(path, train_info_dict, white_background, return_smplx=True) |
| 369 | print("Reading Test Transforms", flush=True) |
| 370 | test_cam_infos, _ = readCamerasDNARendering(path, test_info_dict, white_background, return_smplx=False) |
| 371 | |
| 372 | if not eval: |
| 373 | train_cam_infos.extend(test_cam_infos) |
| 374 | test_cam_infos = [] |
| 375 | |
| 376 | nerf_normalization = getNerfppNorm(train_cam_infos) |
| 377 | |
| 378 | parent_dir = os.path.dirname(os.path.dirname(path)) |
| 379 | ply_path = os.path.join(parent_dir, "points3d.ply") |
| 380 | print("Using SMPLX vertices to initiate", flush=True) |
| 381 | num_pts, _ = smplx_vertices.shape |
| 382 | shs = np.random.random((num_pts, 3)) / 255.0 |
| 383 | pcd = BasicPointCloud(points=smplx_vertices, colors=SH2RGB(shs), normals=np.zeros((num_pts, 3))) |
| 384 | storePly(ply_path, smplx_vertices, SH2RGB(shs) * 255) |
| 385 | |
| 386 | scene_info = SceneInfo(point_cloud=pcd, |
| 387 | train_cameras=train_cam_infos, |
| 388 | test_cameras=test_cam_infos, |
| 389 | nerf_normalization=nerf_normalization, |
| 390 | ply_path=ply_path) |
| 391 | return scene_info |
| 392 | |
| 393 | sceneLoadTypeCallbacks = { |
| 394 | "Colmap": readColmapSceneInfo, |
nothing calls this directly
no test coverage detected