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

WRONG COLOR WHEN CONVERT PARQUET TO PLY #163

Open
ichsan2895 opened this issue Jan 5, 2024 · 8 comments
Open

WRONG COLOR WHEN CONVERT PARQUET TO PLY #163

ichsan2895 opened this issue Jan 5, 2024 · 8 comments

Comments

@ichsan2895
Copy link

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
Copy link
Contributor

jb-ye commented Jan 5, 2024

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.

@ichsan2895
Copy link
Author

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
Copy link
Contributor

jb-ye commented Jan 6, 2024

@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
Copy link
Author

@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
Copy link
Contributor

jb-ye commented Jan 6, 2024

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

@ichsan2895
Copy link
Author

ichsan2895 commented Jan 7, 2024

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
Copy link
Owner

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
Copy link
Author

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

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

3 participants