Anttwo / SuGaR

[CVPR 2024] Official PyTorch implementation of SuGaR: Surface-Aligned Gaussian Splatting for Efficient 3D Mesh Reconstruction and High-Quality Mesh Rendering
https://anttwo.github.io/sugar/
Other
2.36k stars 182 forks source link

I have multiple camera models with different intrinsics, how can I adjust SuGaR's code? #93

Closed yifanlu0227 closed 10 months ago

yifanlu0227 commented 10 months ago

Hi @Anttwo ,

I notice that SuGaR assumes all cameras have the same intrinsics. However, my dataset includes multiple camera models. Could you give me some key points to adjust the current code? For example, I need to modify the render_image_gaussian_rasterizer function.

Thanks!

yifanlu0227 commented 10 months ago

I've made it.

bo233 commented 10 months ago

Hi there, I meet the same problem as you met. It seems that there are too many codes need to be modified. Can you show me of the places where you made modifications? I am extremely grateful.

yifanlu0227 commented 10 months ago

Hi @bo233. The modification is straight forward.

  1. replace those code like sugar.image_height to sugar.nerfmode.training_cameras.height[camera_indices.item()]. This allows you to use individual camera intrinsics stored in nerfmodel. 截屏2024-01-15 15 53 19 You probably need to modify those files: sugar_extractors/coarse_mesh.py, sugar_extractors/refined_mesh.py, sugar_scene/sugar_model.py, sugar_trainers/coarse_density.py, sugar_trainers/coarse_sdf.py, sugar_trainers/refine.py

  2. initialize new mesh rasterizer for each camera. Do not use the sole rasterizer. You probably need to modify those files: sugar_extractors/coarse_mesh.py, sugar_scene/sugar_model.py


My modificiation:

:100644 100644 e19668e c738f97 M        sugar_extractors/coarse_mesh.py
:100644 100644 eb4a815 be75956 M        sugar_extractors/refined_mesh.py
:100644 100644 9ae5947 bb479f6 M        sugar_scene/cameras.py
:100644 100644 9cee6ba d293411 M        sugar_scene/sugar_model.py
:100644 100644 a8a4a1f d95d4ad M        sugar_trainers/coarse_density.py
:100644 100644 cf0ef41 00bea09 M        sugar_trainers/coarse_sdf.py
:100644 100644 f5e17bb 7431548 M        sugar_trainers/refine.py