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

相关推荐
byzh_rc16 小时前
[自然语言处理-入门] 语音合成
人工智能·自然语言处理
无情的西瓜皮16 小时前
MCP协议实战:从零搭建一个AI Agent工具服务器,让大模型真正“动手干活“
运维·服务器·人工智能·mcp
嗷嗷哦润橘_16 小时前
whynotTV徐丹飞:离通用智能机器人还有多远
人工智能·ai·具身智能
手写码匠16 小时前
手写 AI 推理加速引擎:从零实现 KV Cache 与 Speculative Decoding
人工智能·深度学习·算法·aigc
Agent手记16 小时前
能源供应链智能体落地实战:从招标审核到备件调度,AI Agent全链路方案解析
人工智能·能源
不开大的凯207716 小时前
海外AI圈的“五月风暴”:一场没有硝烟的全面战争
大数据·人工智能
染指111016 小时前
7.相似度计算(本地模型下载和使用,在线模型的使用)-RAG基础1
人工智能·机器学习·阿里云·向量·rag
名不经传的养虾人16 小时前
从0到1:企业级AI项目迭代日记 Vol.28|企业AI的交付不是给工具,而是给搭好的能力
大数据·人工智能·ai编程·ai工作流·企业ai·多agent协作
DianSan_ERP17 小时前
自研电商架构:一套API安全对接60+平台
大数据·运维·数据库·人工智能·安全·架构
传说故事17 小时前
【论文阅读】Continual Harness: Online Adaptation for Self-Improving Foundation Agents
论文阅读·人工智能·agent