| s) | |
| test_cam_infos = [] | |
| nerf_normalization = getNerfppNorm(train_cam_infos) | |
| ply_path = os.path.join(path, "points3d.ply") | |
| if not os.path.exists(ply_path): | |
| # Since this data set has no colmap data, we start with random points | |
| num_pts = 100_000 | |
| print(f"Generating random point cloud ({num_pts})...") | |
| # We create random points inside the bounds of the synthetic Blender scenes | |
| xyz = np.random.random((num_pts, 3)) * 2.6 - 1.3 | |
| shs = np.random.random((num_pts, 3)) / 255.0 | |
| pcd = BasicPointCloud(points=xyz, colors=SH2RGB(shs), normals=np.zeros((num_pts, 3))) | |
| storePly(ply_path, xyz, SH2RGB(shs) * 255) | |
| try: | |
| pcd = fetchPly(ply_path) | |
| except: | |
| pcd = None | |
| scene_info = SceneInfo(point_cloud=pcd, | |
| train_cameras=train_cam_infos, | |
| test_cameras=test_cam_infos, | |
| nerf_normalization=nerf_normalization, | |
| ply_path=ply_path) | |
| return scene_info | |
| sceneLoadTypeCallbacks = { | |
| "Colmap": readColmapSceneInfo, | |
| "Blender" : readNerfSyntheticInfo | |
| } |