Julia 中的优质高斯溅射
Better Gaussian Splatting in Julia

原始链接: https://pxl-th.github.io/blog/better-gs-julia/

**GaussianSplatting.jl 2.0** 引入了重大的性能与易用性升级,并完全使用 Julia 构建。主要亮点包括: * **多平台支持:** 利用 `KernelAbstractions.jl`,该库现在通过单一代码库支持 NVIDIA、AMD 和 Apple Silicon (Metal) GPU。 * **响应式 UI:** 全新的多线程架构将渲染和训练与 UI 解耦,确保应用在进行 JIT 编译或数据集加载等繁重的后台任务时,仍能保持交互流畅。 * **高级训练策略:** 增加了对 MCMC 稠密化(densification)的支持,以实现对场景几何结构的精确控制;同时引入深度监督和几何正则化,以提高重建质量并减少伪影。 * **背景管理:** 新增的“天空穹顶”(Sky Dome)功能可有效将天空与场景几何结构分离,从而减少浮动伪影。 * **工作流增强:** 本次更新包括实时损失函数绘图、自动检查点保存、显存使用监控,以及保存/加载摄像机路径和超参数配置(`.toml`)的能力,从而提升了实验的可复现性。 这些改进简化了高斯溅射(Gaussian Splatting)的工作流程,为高保真 3D 重建提供了更强大且友好的使用体验。

Hacker News 新闻 | 往期 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Better Gaussian Splatting in Julia (pxl-th.github.io) 24 分,pxl-th 发布于 2 小时前 | 隐藏 | 往期 | 收藏 | 2 条评论 帮助 hdz 10 分钟前 | 下一条 [–] 能在 Apple Metal 上运行这对 Gaussian Splatting 训练的普及意义重大。记得两年前我还需要一块 RTX Nvidia 显卡才能在 nerfstudio 上运行 splatfacto 之类的程序。深度图和天空盒(sky dome)等优化也非常精妙,3DGS 进步神速。太棒了!回复 aithena 30 分钟前 | 上一条 [–] 太惊人了!回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

GaussianSplatting.jl 2.0 release brings notable quality of life improvements and new capabilities.

Same code, multiple GPU backends

Written entirely in Julia it supports following GPU backends:

  • AMD GPU (AMDGPU.jl)
  • NVIDIA GPU (CUDA.jl)
  • MacBook GPU(Metal.jl)

This is achieved with KernelAbstractions.jl that allows writing a single kernel that get's compiled to a specific target.

Multithreaded UI

To avoid freezing the app during heavy work (such as JIT compilation of GPU kernels, dataset loading, etc.) the app is now split into two threads:

  • Frontend: handles the UI, performs OpenGL rendering, dispatches commands to the backend.
  • Backend: performs Gaussian Splatting rendering, training, dataset loading, etc.

In this way, the UI always stays responsive and user can interact with it, even if there are long-standing jobs in the background. It also shows progress bars that something is happening with tips, instead of becoming frozen like before.

The spinner keeps animating while the dataset loads on the backend thread
and when JIT-compiling kernels for the first training iteration.

UI/UX itself got a big update and is now displays loss plots live during training along with all hyperparameters.

Markov Chain Monte Carlo Strategy

Besides default cloning and splitting densification strategy, we now support MCMC (3D Gaussian Splatting as Markov Chain Monte Carlo) densification strategy.

It allows precise control of the number of Gaussians in the scene and generally relies less on having a good initialization.

Users can select MCMC during dataset loading or in the code with:

Trainer(
    rasterizer, gaussians, dataset, opt_params;
    strategy=MCMCStrategy(; kwargs...),
)

Depth & Geometry Supervision

To improve reconstructed geometry, we can provide depth priors using off-the-shelf depth estimation models. Depth images should be part of the dataset, under <dataset-root>/depths/<FILENAME>.png path.

A dataset image and its estimated depth prior using Depth-Anything 3.

To enable depth supervision, either toggle it in UI or with OptimizationParams(; use_depth_loss=true). Depth maps then provide supervision during training resulting in better geometry and reduced number of floaters.

Since depth may vary between frames, all depth maps are first refitted against prior point cloud to the same scale. The ones that fail refitting are discarded and not used for supervision.

To further improve geometry and smoothness, we can perform geometry regularization to constrain the shape of the surface, while depth supervision constrains only its location. It can be enabled in the UI or with OptimizationParams(; use_normal_loss=true) and performs two things:

  • depth normal consistency pins surface orientation: normals derived from the rendered depth map must align with the per-Gaussian normals.
  • flattening surface: flattening each Gaussian along its smalles axis.
A rendered image, depth and normals of the model with geometry regularization enabled.

Sky Dome

To help disentangle sky / distant background and reduce floaters, GaussianSplatting.jl now supports Sky Dome, which is a frozen shell of Gaussians at a large radius, rendered in its own pass and composited behind the scene.

Sky Dome in a form of a sphere and a hemisphere.

Depending on your environment (e.g. like this fountain above), you may want to prefer hemisphere instead of a sphere, because a full sphere will pull parts of the geometry onto itself, making the ground less opaque. By using hemisphere, the bottom half background is black and does not affect geometry at all.

Comparison of the reconstruction without and with Sky Dome after 3K iterations. With Sky Dome, sky is clearly disentangled from the fountain and does not float around.

The overhead of Sky Dome is negligible (~32K Gaussians) comparing to the rest of the scene (millions of Gaussians).

To further help disentangle the sky, we can use sky segmentation masks obtained from any off-the-shelf sky-segmentation models, which should be part of the dataset under <dataset-root>/sky/<FILENAME>.png path.

A dataset image and its estimated sky mask.

This helps with small details around the edges of geometry, like leaves.

Camera Frustum

Camera frustum visualization got a small quality-of-life update and now shows a miniature picture of the image that the actual camera took.

Some Other Niceties

List of other improvements in no particular order:

  • Automatic checkpointing saves checkpoints every N steps in the selected directory.
  • Custom hyperparameter configuration (learning rate, loss weights, regularization, etc.) can be provided during dataset loading with hyperparameters.toml file (use Load..., Save... buttons). It can also be saved later on if you are satisfied with these values, helping reproducibility.
  • Camera path for Capture Mode can now be saved / loaded and reproduced exactly accross training runs.
  • UI shows how much VRAM is being used by the application.

---

This concludes GaussianSplatting.jl 2.0 update.
Feel free to try and leave the feedback on the GitHub repo.

Thanks! :)

Acknowledgements

← back

联系我们 contact @ memedata.com