实验笔记之——Gaussian-SLAM测试与配置

文章介绍了3DGaussianSplatting的最新进展,它是NeRF领域的突破,能在高质量重建和快速优化速度上实现SOTA效果。作者分享了对源码的测试、配置和实验过程,包括Gaussian-SLAM的开源项目,以及如何使用相关工具进行数据处理和可视化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

之前博客对基于3DGS的SLAM进行了调研

学习笔记之——3D Gaussian Splatting及其在SLAM与自动驾驶上的应用调研_3d gaussian splatting slam-CSDN博客文章浏览阅读4.6k次,点赞49次,收藏82次。论文主页3D Gaussian Splatting是最近NeRF方面的突破性工作,它的特点在于重建质量高的情况下还能接入传统光栅化,优化速度也快(能够在较少的训练时间,实现SOTA级别的NeRF的实时渲染效果,且可以以 1080p 分辨率进行高质量的实时(≥ 30 fps)新视图合成)。开山之作就是论文“3D Gaussian Splatting for Real-Time Radiance Field Rendering”是2023年SIGGRAPH最佳论文。_3d gaussian splatting slamhttps://blog.csdn.net/gwplovekimi/article/details/135397265?spm=1001.2014.3001.5501特别地,下面博客分别对3DGS的源码、SplaTAM的源码、MonoGS的源码进行了测试与解读

学习笔记之——3D Gaussian Splatting源码解读_gaussian splatting源码分析-CSDN博客

学习笔记之——3D Gaussian SLAM,SplaTAM配置(Linux)与源码解读-CSDN博客

实验笔记之——Gaussian Splatting SLAM (MonoGS)配置与测试

而最近,工作《Gaussian-SLAM: Photo-realistic Dense SLAM with Gaussian Splatting》正式开源了,为此用本博文记录本人配置及测试的实验过程。本博文仅供本人学习记录用~

论文链接:https://arxiv.org/pdf/2312.10070.pdf

论文主页:Gaussian-SLAM: Photo-realistic Dense SLAM with Gaussian Splatting

代码链接:https://github.com/VladimirYugay/Gaussian-SLAM

具体的原理方面的介绍在之前博客中有,此处略过~

配置

首先下载源码

git clone https://github.com/VladimirYugay/Gaussian-SLAM

然后创建conda环境

cd Gaussian-SLAM

conda env create -f environment.yml
conda activate gslam

注意必须要保证环境配置正常

然后下载数据集,作者也提供了script进行下载~对于tum之前已经下载过了,为此直接测试

运行下面代码测试,

python run_slam.py configs/<dataset_name>/<config_name> --input_path <path_to_the_scene> --output_path <output_path>

如采用TUM_RGBD/rgbd_dataset_freiburg3_long_office_household,那么应该就是

python run_slam.py configs/TUM_RGBD/rgbd_dataset_freiburg3_long_office_household.yaml --input_path ~/SplaTAM/data/TUM_RGBD/rgbd_dataset_freiburg3_long_office_household --output_path output/TUM_RGBD/rgbd_dataset_freiburg3_long_office_household

然后就开始运行,通过终端输出可以看到运行的效果

跑到一半中断了~好像是内存不够

发现gpu确实被沾满了~~

只能指定gpu后重跑了~

CUDA_VISIBLE_DEVICES=3 对应的运行代码

费时还不少~终于跑完了

关于可视化,特意咨询了作者,答复是

Most of the visualizers use the exported Gaussian model ply file and render it. At the end of the run, during evaluation, we compute both the mesh as @Atticuszz mentioned, and the Gaussian parameters exported in the ply file here.

Having this exported Gaussian ply file, you can use pretty much any visualizer you prefer. For example, for gs-splatting-lightning, you can install their repo, and just call `visualize.py <path_to_the_exported_gaussian_model.ply>. After this you can play around with the parameters and the camera trajectory fly-through.

先试试运行下面命令

python run_evaluation.py --config_path  configs/TUM_RGBD/rgbd_dataset_freiburg3_long_office_household.yaml --checkpoint_path output/TUM_RGBD/rgbd_dataset_freiburg3_long_office_household

好像并不行。而作者的回复也是摸棱两可

但是通过报错可以看到应该只是找不到路径,修改数据路径再看看

开始执行rendering验证了~职系那个完成后会生成.ply文件

看样子是要进行一系列的refinement才可以,为什么train出来的还要用data 重新refinement来可视化呢???

mapping result里面确实可以看到一些结果,但没有可视化三维模型~

从github的readme看应该是用下面仓库来进行可视化的。

GitHub - yzslab/gaussian-splatting-lightning

因此先对其进行编译安装~

# clone repository
git clone --recursive https://github.com/yzslab/gaussian-splatting-lightning.git
cd gaussian-splatting-lightning
# if you forgot the `--recursive` options, you can run below git commands after cloning:
#   git submodule sync --recursive
#   git submodule update --init --recursive --force


# create virtual environment
conda create -yn gspl python=3.9 pip
conda activate gspl

# install the PyTorch first, you must install the one match to the version of your nvcc (nvcc --version)
# for cuda 11.7
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2
# for cuda 11.8
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118

# install other requirements
pip install -r requirements.txt

# below requirements are optional
#   if you want to train with appearance variation images
pip install ./submodules/tiny-cuda-nn-fp32/bindings/torch
#   if you want to use nerfstudio-project/gsplat
pip install gsplat==0.1.8

运行下面代码进行可视化

python viewer.py TRAINING_OUTPUT_PATH

在本次实验中为如下:
python viewer.py /home/gwp/Gaussian-SLAM/output/TUM_RGBD/rgbd_dataset_freiburg3_long_office_household/rgbd_dataset_freiburg3_long_office_household_global_map.ply

运行后如下图所示

然后打开浏览器,先输入

远程ip:8080

测试效果

Gaussian-SLAM testing tum

代码解读

至于代码解读就不额外写博客了,看后续把中文注释放到下面GitHub中

KwanWaiPang/Gaussian-SLAM_comment · GitHubContribute to KwanWaiPang/Gaussian-SLAM_comment development by creating an account on GitHub.icon-default.png?t=N7T8https://github.com/KwanWaiPang/Gaussian-SLAM_comment

Gaussian-SLAM(尺度因子SLAM,Scale-Invariant SLAM)是一种基于概率图模型的SLAM( simultaneous localization and mapping)算法,它通常用于处理视觉传感器的数据。这种算法利用高斯分布来建模地图和机器人状态,因此对尺度变化有较好的鲁棒性。 复现Gaussian-SLAM代码的过程一般包括以下几个步骤: 1. **环境理解**:收集数据,如摄像头图像,通过特征检测和描述符提取(如SIFT、SURF等)获取关键点和它们的位置估计。 2. **初始化**:设置先验地图,通常是空的,以及机器人初始位姿的猜测。 3. **循环更新**: - **局部匹配**:将新来的图像前一帧或地图的关键点进行匹配,计算对应关系。 - **位姿估计**:根据匹配结果,使用优化技术(比如粒子滤波器或后向信息传播)估计当前相机姿态。 - **地图更新**:融合新的观测和估计的姿态,更新地图中的关键点位置。 4. **全局优化**:定期运行全局优化,例如束搜索或Levenberg-Marquardt优化,以解决局部最小的问题,并进一步精确定位和地图结构。 5. **代码实现**:可以选择使用Python(如PCL库)、C++(如ORB-SLAM)或ROS等框架编写代码,同时依赖相关的数学库如Eigen、g2o等。 要复现这个算法,你需要熟悉SLAM原理,了解相关的数学知识(如概率论、线性代数),并且有一定的编程基础。如果你需要更具体的指导,可以查阅相关论文、开源项目文档或者在线教程。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值