PVG
PVG copied to clipboard
Real time viewer?
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!
Hi, we do not provide a viewer for visualization, but you can try the viewer in 3DGS repo.
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!
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.
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)
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?
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?
@APPZ99 This is a dynamic scene, so the point cloud only makes sense at a certain time t. Because xyz is time dependent
@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?
@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 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 thank you, that works
@TGpastor Is the rendering result good? I'm not sure if my code is correct
@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)