Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PLY exported from NGP? #175

Open
463f opened this issue Mar 25, 2024 · 0 comments
Open

Use PLY exported from NGP? #175

463f opened this issue Mar 25, 2024 · 0 comments

Comments

@463f
Copy link

463f commented Mar 25, 2024

The code below is from gaussian_splatting/scene/dataset_readers.py.

  1. I wonder if this is from colmap or someother places?
  2. I try to use the transforms.json and PLY file exported from NGP as input, and both of them are in nerf coordinate. I check the dataset_readers.py code and find the transforms.json is converted to COLMAP coordinate. Is that means the NGP PLY file is not matched to the converted transforms.json, so I cannot use the NGP PLY file? What if I don't do the coordinate convertion(delete the convertion code of dataset_readers file) and make both json and PLY stay in NeRF coordinate?

Is anyone have some advice? Thanks a lot!!!

def readNerfSyntheticInfo(path, white_background, eval, extension=".png"):
    print("Reading Training Transforms")
    train_cam_infos = readCamerasFromTransforms(path, "transforms_train.json", white_background, extension)
    print("Reading Test Transforms")
    test_cam_infos = readCamerasFromTransforms(path, "transforms_test.json", white_background, extension)
    
    if not eval:
        train_cam_infos.extend(test_cam_infos)
        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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant