wanmeihuali / taichi_3d_gaussian_splatting

An unofficial implementation of paper 3D Gaussian Splatting for Real-Time Radiance Field Rendering by taichi lang.
Apache License 2.0
633 stars 57 forks source link

WRONG COLOR WHEN CONVERT PARQUET TO PLY #163

Open ichsan2895 opened 6 months ago

ichsan2895 commented 6 months ago

I got wrong color between taichi viewer and PLY which converted from parquet. It got right color when opened by viewer but got strange color with PLY which is more contrast.

conda activate my_environment

cd /media/ichsan/DISK/taichi_3d_gaussian_splatting/

python3 visualizer.py --parquet_path_list OUTPUT/truck/best_scene.parquet

image

######### I convert to PLY using this code. The PLY can be opened by Antimatter15 WebGL Splat viewer

conda activate my_environment

cd /media/ichsan/KERJAAN/Linux_World/taichi_3d_gaussian_splatting/

python3 parquet_to_ply.py --parquet_path OUTPUT/truck/best_scene.parquet --ply_path OUTPUT/truck/point_cloud.ply

image

########

Python version==3.10.10
CUDA version==12.1.105

taichi==1.7.0
taichi-3d-gaussian-splatting==0.0.1
torch==2.1.2
torchvision==0.16.2
plyfile==1.0.2
jb-ye commented 6 months ago

I wrote this ply conversion function. But since the taichi-gs is using a different color parameterization, the exported ply is not consistent with the official ply. See https://github.com/wanmeihuali/taichi_3d_gaussian_splatting/issues/150 for more details.

ichsan2895 commented 6 months ago

I wrote this ply conversion function. But since the taichi-gs is using a different color parameterization, the exported ply is not consistent with the official ply. See #150 for more details.

Sorry I am not advance in coding, but the problem seems come from function to_ply instead of max(0, <SH, dir> + 0.5). I guess that because it has right color when opened with taichi-viewer.

This is originial implementation of save_ply : https://github.com/graphdeco-inria/gaussian-splatting/blob/2eee0e26d2d5fd00ec462df47752223952f6bf4e/scene/gaussian_model.py#L177

There is multiply calculation of f_dc & f_rest. But, I don't see the multiplication on this implementation. Is that cause problem? @jb-ye

def construct_list_of_attributes(self):
        l = ['x', 'y', 'z', 'nx', 'ny', 'nz']
        # All channels except the 3 DC
        for i in range(self._features_dc.shape[1]*self._features_dc.shape[2]):
            l.append('f_dc_{}'.format(i))
        for i in range(self._features_rest.shape[1]*self._features_rest.shape[2]):
            l.append('f_rest_{}'.format(i))
jb-ye commented 6 months ago

@ichsan2895 No. What you observe is caused by not using max(0, <SH, dir> + 0.5) in color parameterization in taichi training. The taichi-viewer is consistent as it uses the same color parameterization sigmoid(<SH, dir>) as done in taichi training. There are a few other difference regarding how tiny gaussians are treated between official GS and taichi GS. The expectation is the exported ply shouldn't be used interchangeably at the moment.

ichsan2895 commented 6 months ago

@ichsan2895 No. What you observe is caused by not using max(0, <SH, dir> + 0.5) in color parameterization in taichi training. The taichi-viewer is consistent as it uses the same color parameterization sigmoid(<SH, dir>) as done in taichi training. There are a few other difference regarding how tiny gaussians are treated between official GS and taichi GS. The expectation is the exported ply shouldn't be used interchangeably at the moment.

I see, hopefully someone can fix the problem too. Taichi3D-GSplat is a great tool. It outperform nerfstudio's gsplat implementation and rivaling with your gsplat implementation.

jb-ye commented 6 months ago

Well, technically speaking, both the improved performance of taichi-gs and nerfstudio-gs are contributed by me. LOL

ichsan2895 commented 6 months ago

Well, technically speaking, both the improved performance of taichi-gs and nerfstudio-gs are contributed by me. LOL

Yes, I also thank the maker of this repo @wanmeihuali

wanmeihuali commented 6 months ago

Thank you all! Sorry for not replying for a long time. Due to some reason, I cannot contribute to this repo anymore(majorly because of my new company's open-source policy...). My friends @yanzhoupan and @Alexma3312 are now maintaining this repo, and you can ask for their help if needed.

ichsan2895 commented 6 months ago

Thank you all! Sorry for not replying for a long time. Due to some reason, I cannot contribute to this repo anymore(majorly because of my new company's open-source policy...). My friends @yanzhoupan and @Alexma3312 are now maintaining this repo, and you can ask for their help if needed.

Glad to hear this repo is still maintaned by your friends (@yanzhoupan @Alexma3312 ) :ok: