2 Star 0 Fork 0

Kahsolt/diff-gaussian-rasterization

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
Kahsolt- Kahsolt fix b9b9553 1年前
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Differential Gaussian Rasterization with Importances

This is a fork of the original rasterization engine diff-gaussian-rasterization for the paper "3D Gaussian Splatting for Real-Time Rendering of Radiance Fields". We add a new salar attribute namely "importance" to each guassian, and implement both forward & backward pass for it.

Modeling formula:

⚪ Forward

Following the definition of rendered image color C, which derives from the accumulation of guassian color multiplied by a learnable opacityi both exponentially decayed w.r.t. the depth from viewpoint and zig-zagly decayed w.r.t. the sorted depth order:

C=iNciαii1j=1(1αj)

where αi=opacityiepower, and power<=0 interprets as the viewpoint depth.

We define here the importance map O in pixel space as:

O=iNoiαii1j=1(1αj)

⚪ Backward

Since the per-pixel importance Oi is derived from the accumulation per-Gaussian importance oi, conducting the chaining rule to obtain the gradients:

Loi=LOOoi=LO[αii1j=1(1αj)]

noted that the right part [] has already been computed in the forward pass, we might simply cache it and reuse; but the original repo code recomputes it again (like pytorch checkpointing mechanism), trading time for less VRAM usage

Additionally, the importance oi interacts with opacity αi, hence the gradients of opacity will add this new term:

Lαi+=LOOαi=LO[oii1j=1(1αj)]

again the right part [] is implemented in a recursive way following the original code, by making good use of the forward formula, here we show the rough idea:

oii1j=1(1αj)=Oj1k=1Okαi

Code usage:

ℹ We provide source code only, for compiling how-tos follow the original guide

from diff_gaussian_rasterization_ks import GaussianRasterizationSettings, GaussianRasterizer

# modified version with importance attribute
pc: GaussianModel
# [num_points, D=1], alike opacity
importance = pc.get_importance

rasterizer = GaussianRasterizer(raster_settings=...)
rendered_image, importance_map, radii = rasterizer(
  means3D = means3D,
  means2D = means2D,
  shs = shs,
  colors_precomp = colors_precomp,
  opacities = opacity,
  importances = importance,   # <- new pointcloud attributes
  scales = scales,
  rotations = rotations,
  cov3D_precomp = cov3D_precomp,
)

# [H, W], alike rendered_image but without channel dim C
importance_map  # <- rendered in pixel space

Acknowledgements

@Article{kerbl3Dgaussians,
      author       = {Kerbl, Bernhard and Kopanas, Georgios and Leimk{\"u}hler, Thomas and Drettakis, George},
      title        = {3D Gaussian Splatting for Real-Time Radiance Field Rendering},
      journal      = {ACM Transactions on Graphics},
      number       = {4},
      volume       = {42},
      month        = {July},
      year         = {2023},
      url          = {https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/}
}

by Armit 2024/03/27

空文件

简介

取消

发行版

暂无发行版

贡献者 (6)

全部

近期动态

1年多前强推了提交到 main 分支,fb3aa8b...b9b9553
1年多前强推了提交到 main 分支,9fd6ae9...fb3aa8b
1年多前推送了新的提交到 main 分支,3a5cb2a...9fd6ae9
1年多前推送了新的提交到 main 分支,cb8473c...3a5cb2a
1年多前推送了新的提交到 main 分支,25d14e0...cb8473c
加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kahsolt/diff-gaussian-rasterization.git
git@gitee.com:kahsolt/diff-gaussian-rasterization.git
kahsolt
diff-gaussian-rasterization
diff-gaussian-rasterization
main

搜索帮助