PVG icon indicating copy to clipboard operation
PVG copied to clipboard

Real time viewer?

Open antithing opened this issue 11 months ago • 12 comments

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!

antithing avatar Mar 19 '24 13:03 antithing

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

SuLvXiangXin avatar Mar 20 '24 05:03 SuLvXiangXin

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!

antithing avatar Mar 20 '24 11:03 antithing

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.

SuLvXiangXin avatar Mar 21 '24 15:03 SuLvXiangXin

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?

li199603 avatar Mar 27 '24 07:03 li199603

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

APPZ99 avatar Apr 21 '24 10:04 APPZ99

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

li199603 avatar Apr 22 '24 01:04 li199603

@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?

APPZ99 avatar Apr 22 '24 03:04 APPZ99

@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?

TGpastor avatar May 21 '24 01:05 TGpastor

@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

li199603 avatar May 21 '24 02:05 li199603

@li199603 thank you, that works

TGpastor avatar May 21 '24 06:05 TGpastor

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

li199603 avatar May 21 '24 07:05 li199603

@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)

TGpastor avatar May 21 '24 09:05 TGpastor