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

How to Export a 3D Model (PLY/OBJ) from 3DGS #1178

Open
RichardMLuu opened this issue Mar 1, 2025 · 2 comments
Open

How to Export a 3D Model (PLY/OBJ) from 3DGS #1178

RichardMLuu opened this issue Mar 1, 2025 · 2 comments

Comments

@RichardMLuu
Copy link

Thanks for the great work on 3D Gaussian Splatting! The rendering results look amazing.

I’m trying to export the 3D model in a format that can be opened in Blender or MeshLab (e.g., .ply or .obj), but the current pipeline seems to focus on rendering videos instead. I’d like to know:

  1. Is there a way to export the Gaussian point cloud as a .ply or .obj file?
  2. If not, what modifications would be needed to achieve this?
  3. Is there a recommended way to convert the exported point cloud into a mesh?

Would appreciate any guidance on this!

@RichardMLuu
Copy link
Author

Description:
I implemented a script to export a point cloud from the Gaussian model. The script appears to work correctly, but the generated .ply file contains significantly more points than the original input.ply. I'm unsure whether this redundancy is an expected behavior of the model or if there might be an issue in my implementation.

Is this an inherent property of the Gaussian representation, or should I refine my export process? Any insights would be appreciated.

Code Summary:

def export_gaussians_to_ply(gaussians, filename):
    xyz = gaussians.get_xyz.detach().cpu().numpy()
    colors_dc = gaussians.get_features_dc.detach().squeeze(1).cpu().numpy()  
    colors = (colors_dc + 0.5).clip(0, 1)

    pcd = o3d.geometry.PointCloud()
    pcd.points = o3d.utility.Vector3dVector(xyz)
    pcd.colors = o3d.utility.Vector3dVector(colors)
    o3d.io.write_point_cloud(filename, pcd)

@jaco001
Copy link

jaco001 commented Mar 2, 2025

  1. GS ply is point cloud with extra data like SH, transparency etc. There are more and more tools to use GS ply like blender addons to import or render splats.
  2. You see more points in the file because in the "normal view" of GS you don't see the transparent ones.
  3. If you need mesh try standard photogrammetry. GS are shortcut to get model with baked rendered light properties like specular, opacity, GI etc. This have prons and cons.

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

2 participants