taichi_3d_gaussian_splatting icon indicating copy to clipboard operation
taichi_3d_gaussian_splatting copied to clipboard

WRONG COLOR WHEN CONVERT PARQUET TO PLY

Open ichsan2895 opened this issue 1 year ago • 8 comments

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

ichsan2895 avatar Jan 05 '24 17:01 ichsan2895

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.

jb-ye avatar Jan 05 '24 20:01 jb-ye

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))

ichsan2895 avatar Jan 05 '24 23:01 ichsan2895

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

jb-ye avatar Jan 06 '24 01:01 jb-ye

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

ichsan2895 avatar Jan 06 '24 06:01 ichsan2895

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

jb-ye avatar Jan 06 '24 17:01 jb-ye

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

ichsan2895 avatar Jan 07 '24 02:01 ichsan2895

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.

wanmeihuali avatar Jan 07 '24 03:01 wanmeihuali

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:

ichsan2895 avatar Jan 07 '24 14:01 ichsan2895