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

Real time viewer? #7

Open
antithing opened this issue Mar 19, 2024 · 12 comments
Open

Real time viewer? #7

antithing opened this issue Mar 19, 2024 · 12 comments

Comments

@antithing
Copy link

Are there any viewers capable of running the results of your training? It would be great to have a 3d viewport to evaluate the results!

@SuLvXiangXin
Copy link
Collaborator

Hi, we do not provide a viewer for visualization, but you can try the viewer in 3DGS repo.

@antithing
Copy link
Author

Okay thanks. I have now trained a model, and the output is chkpnt40000.pth. All the viewers I can find take a ply file, is there a conversion that I can do to get a ply from the pth?

Thanks again!

@SuLvXiangXin
Copy link
Collaborator

It's not good to directly visualize the ply point cloud, as we introduce some extra parameter as discussed in paper, such as t or t_scale, which are essential for rendering.

@li199603
Copy link

li199603 commented Mar 27, 2024

I try to get a ply from the pth. Referring to 3DGS repo, the following code is written.

def save_ply(self, path, t):
    os.makedirs(os.path.dirname(path))
    xyz = self.get_xyz_SHM(t).detach().cpu().numpy()
    normals = np.zeros_like(xyz)
    f_dc = self._features_dc.detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
    f_rest = self._features_rest.detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
    opacities = self.inverse_opacity_activation(self.get_opacity * self.get_marginal_t(t)).detach().cpu().numpy()
    scale = self._scaling.detach().cpu().numpy()
    rotation = self._rotation.detach().cpu().numpy()

    dtype_full = [(attribute, 'f4') for attribute in self.construct_list_of_attributes()]

    elements = np.empty(xyz.shape[0], dtype=dtype_full)
    attributes = np.concatenate((xyz, normals, f_dc, f_rest, opacities, scale, rotation), axis=1)
    elements[:] = list(map(tuple, attributes))
    el = PlyElement.describe(elements, 'vertex')
    PlyData([el]).write(path)

visualization
There are only two differences from 3DGS repo, which are the acquisition of xyz and opacities. But the visualization is not ideal. how should i correct this code?

@APPZ99
Copy link

APPZ99 commented Apr 21, 2024

Hi!@li199603

Can your code save the entire point cloud map? I also referred to the Save_ply function of 3DGS, but the obtained point clouds were mixed together.

Where does the t in the code come from?

image

@li199603
Copy link

@APPZ99
This is a dynamic scene, so the point cloud only makes sense at a certain time t. Because xyz is time dependent

@APPZ99
Copy link

APPZ99 commented Apr 22, 2024

@li199603
Thank you for your answer!I think I got it. But I'm still confused on a few points.

So it is difficult for me to directly obtain the complete map of the entire sequence. If I need a complete map, I may need to obtain the point cloud information at each time and then perform point cloud registration to obtain it?

However, for static objects in the scene (such as buildings, road signs, etc.), their approximate positions should be similar, so if the position information of the point cloud is derived not based on a certain time t, a static scene should be obtained (but there is no )?

I don’t know if my understanding is correct?

@TGpastor
Copy link

@li199603 Thank you for your code, I have successfully got the ply file, but when I tried to use the viewer from 3DGS, it told me ""Could not find config file 'cfg_args' ",could you tell me how can I get this config file?

@li199603
Copy link

@li199603 Thank you for your code, I have successfully got the ply file, but when I tried to use the viewer from 3DGS, it told me ""Could not find config file 'cfg_args' ",could you tell me how can I get this config file?

echo "Namespace(sh_degree=3)" > cfg_args

@TGpastor
Copy link

@li199603 thank you, that works

@li199603
Copy link

@TGpastor Is the rendering result good? I'm not sure if my code is correct

@TGpastor
Copy link

@TGpastor Is the rendering result good? I'm not sure if my code is correct

actually, I could open the viewer,but nothing will display in "point view" window, maybe there are some problems in save_ply()?(I set time t as 1)

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

5 participants