3D Gaussian Splatting论文简要解读与可视化复现(基于gsplat)

3D Gaussian Splatting介绍

3D Gaussian Splatting流程

gsplat的输入是经过COLMAP处理得到的稀疏点云用来初始化,但是在训练之后会变稠密

🚫 标准的 3D Gaussian Splatting 不使用神经网络。

✅ 它是一个 纯参数优化 (non-neural, direct optimization) 的方法。

优化流程:

代码实现:

基于下面的gsplat仓库:

https://docs.gsplat.studio/main/index.htmlhttps://docs.gsplat.studio/main/index.html安装gsplat

bash 复制代码
conda create --name gsplat -y python=3.8
conda activate gsplat

pip install torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118

conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
bash 复制代码
pip install gsplat

这个过程需要安装很多依赖项

下载仓库:

bash 复制代码
git clone https://github.com/nerfstudio-project/gsplat.git

还需要手动安装一些其他的库:

(在./example/requirements.txt文件下,注释掉这几个并单独安装)

nerfview

fused-ssim

fused-bilagrid

bash 复制代码
pip install nerfview
pip install git+https://github.com/rahul-goel/fused-ssim/ --no-build-isolation

git clone https://github.com/harry7557558/fused-bilagrid.git
cd fused-bilagrid
pip install . --no-build-isolation

这里需要改一下源代码/data/xxx/projects/gsplat/examples/datasets/colmap.py

,把"no_factor_suffix": 改成True,使得代码可以兼容COLMAP的结果:

python 复制代码
        # Load extended metadata. Used by Bilarf dataset.
        self.extconf = {
            "spiral_radius_scale": 1.0,
            "no_factor_suffix": True, # False
        }

最后运行下面的代码即可复现:

data_dir 会自动找到mycolmap_project/sparse/0的模型位置

bash 复制代码
cd examples

CUDA_VISIBLE_DEVICES=0 python simple_trainer.py default \
    --data_dir /data/xxx/projects/colmap/mycolmap_project/ --data_factor 1 \
    --result_dir ./results/my_scene

可视化结果:

可以看到gsplat一步步的训练过程,生成的效果越来越精细

但是超出场景的远景视角还是可以看到有很多不足的

可以看到过程中高斯点会越来越多,画面越来越精细

对显存的占用不是很高

下图左侧为高斯重建结果,右侧为原图,可以发现把图拉近之后效果还是可以的

总共14张图片,训练时长在10mins左右,可以选择保存ply文件(但是会很大,因为最后会有很多点,我这个就有120MB)


gsplat的ply文件

gsplat的ply文件格式与普通的ply文件有所不同:

.ply 文件头部是 3D Gaussian Splatting(高斯渲染) 模型导出的点云文件头。

这些字段定义了每个点的属性(不仅仅是 xyz 坐标),而是包含了 颜色、方向、尺度、旋转等参数 ------

也就是"每个点是一个三维高斯分布(3D Gaussian)",而非简单的几何点。

bash 复制代码
ply
format binary_little_endian 1.0
element vertex 533057
property float x
property float y
property float z
property float f_dc_0
property float f_dc_1
property float f_dc_2
property float f_rest_0
property float f_rest_1
property float f_rest_2
property float f_rest_3
property float f_rest_4
property float f_rest_5
property float f_rest_6
property float f_rest_7
property float f_rest_8
property float f_rest_9
property float f_rest_10
property float f_rest_11
property float f_rest_12
property float f_rest_13
property float f_rest_14
property float f_rest_15
property float f_rest_16
property float f_rest_17
property float f_rest_18
property float f_rest_19
property float f_rest_20
property float f_rest_21
property float f_rest_22
property float f_rest_23
property float f_rest_24
property float f_rest_25
property float f_rest_26
property float f_rest_27
property float f_rest_28
property float f_rest_29
property float f_rest_30
property float f_rest_31
property float f_rest_32
property float f_rest_33
property float f_rest_34
property float f_rest_35
property float f_rest_36
property float f_rest_37
property float f_rest_38
property float f_rest_39
property float f_rest_40
property float f_rest_41
property float f_rest_42
property float f_rest_43
property float f_rest_44
property float opacity
property float scale_0
property float scale_1
property float scale_2
property float rot_0
property float rot_1
property float rot_2
property float rot_3
end_header

解析:

由于 gsplat 并不是从几何角度直接重建三维结构,因此其输出的 PLY 文件 中的点并不完全对应真实空间中的表面位置点。

直接可视化这些点云时,结果往往呈现为一团分布的点,而不是清晰的三维场景结构。这些非几何位置点主要起到**表示环境辐射场或光照分布(appearance / radiance modeling)**的作用,而非真实几何形状。

相关推荐
撸码猿3 小时前
《Python AI入门》第9章 让机器读懂文字——NLP基础与情感分析实战
人工智能·python·自然语言处理
二川bro3 小时前
多模态AI开发:Python实现跨模态学习
人工智能·python·学习
张彦峰ZYF3 小时前
AI赋能原则1解读思考:超级能动性-AI巨变时代重建个人掌控力的关键能力
人工智能·ai·aigc·ai-native
love530love3 小时前
【笔记】ComfUI RIFEInterpolation 节点缺失问题(cupy CUDA 安装)解决方案
人工智能·windows·笔记·python·插件·comfyui
Lucky小小吴4 小时前
Google《Prompt Engineering》2025白皮书——最佳实践十四式
人工智能·prompt
AI科技星4 小时前
为什么变化的电磁场才产生引力场?—— 统一场论揭示的时空动力学本质
数据结构·人工智能·经验分享·算法·计算机视觉
青瓷程序设计4 小时前
昆虫识别系统【最新版】Python+TensorFlow+Vue3+Django+人工智能+深度学习+卷积神经网络算法
人工智能·python·深度学习
咩图4 小时前
C#创建AI项目
开发语言·人工智能·c#
深蓝海拓4 小时前
opencv的模板匹配(Template Matching)学习笔记
人工智能·opencv·计算机视觉
美林数据Tempodata4 小时前
李飞飞最新论文深度解读:从语言到世界,空间智能将重写AI的未来十年
人工智能·ai·空间智能