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)**的作用,而非真实几何形状。

相关推荐
deephub3 小时前
REFRAG技术详解:如何通过压缩让RAG处理速度提升30倍
人工智能·python·大语言模型·rag
Dongsheng_20194 小时前
【泛3C篇】AI深度学习在手机背板外观缺陷检测应用方案
图像处理·人工智能·计算机视觉·视觉检测·边缘计算
AI360labs_atyun4 小时前
AI教育开启新篇章
人工智能·百度·ai
成为深度学习高手4 小时前
DGCN+informer分类预测模型
人工智能·分类·数据挖掘
ouliten4 小时前
cuda编程笔记(29)-- CUDA Graph
笔记·深度学习·cuda
minhuan4 小时前
构建AI智能体:六十六、智能的边界:通过偏差-方差理论理解大模型的能力与局限
人工智能·方差·偏差·方差-偏差分解·方差-偏差权衡·模型调优
润 下4 小时前
C语言——深入解析C语言指针:从基础到实践从入门到精通(四)
c语言·开发语言·人工智能·经验分享·笔记·程序人生·其他
koo3644 小时前
李宏毅机器学习笔记25
人工智能·笔记·机器学习
余俊晖4 小时前
如何让多模态大模型学会“自动思考”-R-4B训练框架核心设计与训练方法
人工智能·算法·机器学习