fudan-zvg / PVG

Periodic Vibration Gaussian: Dynamic Urban Scene Reconstruction and Real-time Rendering
https://fudan-zvg.github.io/PVG/
MIT License
199 stars 6 forks source link

Real time viewer? #7

Open antithing opened 2 months ago

antithing commented 2 months ago

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 commented 2 months ago

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

antithing commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 4 weeks ago

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 commented 4 weeks ago

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

APPZ99 commented 4 weeks ago

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