Kunhao-Liu / StyleGaussian

[Arxiv 2024] StyleGaussian: Instant 3D Style Transfer with Gaussian Splatting
https://kunhao-liu.github.io/StyleGaussian/
113 stars 10 forks source link

How to save a point cloud file? #7

Open soohyoen opened 1 month ago

soohyoen commented 1 month ago

Hi your research is really cool and practical! But I want to save the result of applying the style in point cloud form .ply. Can you tell me about this?

Kunhao-Liu commented 1 month ago

Hi, thank you for your kind words! To save the stylized point cloud as a .ply file, you can follow the saving code of the original 3DGS repo: https://github.com/graphdeco-inria/gaussian-splatting/blob/main/scene/gaussian_model.py#L191. You can change the f_dc, f_rest attributes to the stylized color and save the stylized point cloud.

soohyoen commented 1 month ago

@Kunhao-Liu How can I write the code? I'm a beginner, so I don't know

soohyoen commented 1 month ago

I finally settled it. I took the rgb value as the rendered override value and saved it as sh. But the code to save as sh is in [this]https://github.com/Kunhao-Liu/StyleGaussian/blob/main/scene/gaussian_model.py#L172-L195 part of yours, Can you explain this code?