hustvl / GaussianDreamer

GaussianDreamer: Fast Generation from Text to 3D Gaussians by Bridging 2D and 3D Diffusion Models (CVPR 2024)
https://taoranyi.com/gaussiandreamer/
Apache License 2.0
689 stars 36 forks source link

About initializing point clouds #10

Closed ch1998 closed 11 months ago

ch1998 commented 12 months ago

Hi, in your project page,your use the point clouds with the added ground to initialize the 3D Gaussians. If I want to modify the initialized point cloud similarly, how should I import the point cloud?

Regards

taoranyi commented 11 months ago

Hi, you can see this code:

def add_bg(self,coords,rgb):
        num_pts = 30000
        bound = 0.4
        xy = 5.0
        z_coords = coords[:, 2] 
        min_value = np.min(z_coords)  
        xyz = np.random.random((num_pts, 3)) * np.array([[xy, xy, bound]]) - np.array([[xy/2.0,xy/2.0, 4.0 * bound/5.0]])+ np.array([[0,0,min_value]])
        shs = np.random.random((num_pts, 3)) / 255.0
        colors = SH2RGB(shs)
        all_coords = np.concatenate([coords,xyz],axis=0)
        all_rgb = np.concatenate([rgb,colors],axis=0)
        return all_coords,all_rgb

And you can use this function in https://github.com/hustvl/GaussianDreamer/blob/ad96913c6582cb876cd8137ec7fd4c0b237b2750/threestudio/systems/GaussianDreamer.py#L221

ch1998 commented 11 months ago

Thank you very much, I am eager to start trying it