BAD-Gaussians

BAD-Gaussians

基于高斯散射的3D场景去模糊重建与新视角合成技术

BAD-Gaussians是一种创新的3D场景重建方法,结合束调整和高斯散射技术,有效处理运动模糊图像。该方法不仅能实现高质量的图像去模糊,还可合成新视角场景。基于nerfstudio框架实现,BAD-Gaussians支持多种数据集和训练模式,为计算机视觉和图形学研究提供了有力工具。

BAD-Gaussians高斯散射图像去模糊新视角合成3D重建Github开源项目
<h1 align=center font-weight:100> 😈<strong><i>BAD-Gaussians</i></strong>: <strong><i>B</i></strong>undle-<strong><i>A</i></strong>djusted <strong><i>D</i></strong>eblur 高斯散射</h1>

<a href="https://arxiv.org/abs/2403.11831"><img src="https://yellow-cdn.veclightyear.com/835a84d5/cb468e25-3858-42bb-ab1d-4a6775abd13a.svg"></a> <a href="https://lingzhezhao.github.io/BAD-Gaussians/"><img src="https://yellow-cdn.veclightyear.com/835a84d5/cd955ff3-24cd-4525-ad8c-c1904c1215be.svg"/></a>

这是我们 arXiv 2024 论文 BAD-Gaussians: Bundle Adjusted Deblur Gaussian Splatting 的官方实现,基于 nerfstudio 框架。

演示

Deblur-NeRF 的真实世界运动模糊数据上的去模糊和新视角合成结果:

<video src="https://github.com/WU-CVGL/BAD-Gaussians/assets/43722188/703fbf8d-adb8-4472-b685-6dbe45bb0057"></video>

左:BAD-Gaussians 去模糊的新视角渲染结果;

右:输入图像。

快速开始

1. 安装

你可以查看原始 nerfstudio 仓库了解先决条件和依赖项。 目前,我们的代码库已在 nerfstudio v1.0.3 上进行测试。

简而言之:你可以通过以下方式安装 nerfstudio

# (可选) 创建一个新的 conda 环境 conda create --name nerfstudio -y "python<3.11" conda activate nerfstudio # 安装依赖 pip install --upgrade pip setuptools 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 # 安装 nerfstudio! pip install nerfstudio==1.0.3

然后你可以将此仓库作为 Python 包安装:

pip install git+https://github.com/WU-CVGL/BAD-Gaussians

2. 准备数据集

Deblur-NeRF 合成数据集(重新渲染)

如之前 BAD-NeRF 论文所述,我们对 Deblur-NeRF 的合成数据集进行了重新渲染,每张模糊图像有 51 个插值。

此外,在之前的 BAD-NeRF 论文中,我们直接在只有模糊图像的情况下运行 COLMAP,既没有真实相机内参也没有清晰的新视角图像。我们发现这对 COLMAP 来说相当具有挑战性 - 它可能无法重建场景,我们需要多次重新运行 COLMAP。为此,我们提供了一组新数据,其中我们使用真实相机内参在模糊和清晰的新视角图像上运行 COLMAP,命名为 bad-nerf-gtK-colmap-nvs

下载链接

Deblur-NeRF 真实数据集

你可以直接从 Deblur-NeRF 下载 real_camera_motion_blur 文件夹。

你的自定义数据集

  1. 使用 Nerfstudio 的 ns-process-data 工具 处理 deblur-nerf 训练图像。

    例如,如果 BAD-NeRF 的数据集llff_data 中,执行:

    ns-process-data images \
        --data llff_data/blurtanabata/images \
        --output-dir data/my_data/blurtanabata
    
  2. 文件夹 data/my_data/blurtanabata 已准备就绪。

注意:尽管 nerfstudio 不为 LLFF 数据建模 NDC 场景收缩,但我们发现 scale_factor = 0.25 在 LLFF 数据集上效果很好。 如果你的数据是以 LLFF 方式 捕获的(即前向视角),而不是像 Mip-NeRF 360 那样以物体为中心, 你可以将 scale_factor = 0.25 参数传递给 nerfstudio 数据解析器(在我们的 DeblurNerfDataParser 中已设置为默认值), 例如,ns-train bad-gaussians --data data/my_data/my_seq --vis viewer+tensorboard nerfstudio-data --scale_factor 0.25

3. 训练

  1. 对于 Deblur-NeRF 合成 数据集,使用以下命令训练:

    ns-train bad-gaussians \ --data data/bad-nerf-gtK-colmap-nvs/blurtanabata \ --pipeline.model.camera-optimizer.mode "linear" \ --vis viewer+tensorboard \ deblur-nerf-data

    其中

    • --data data/bad-nerf-gtK-colmap-nvs/blurtanabata 是数据序列的相对路径;
    • --pipeline.model.camera-optimizer.mode "linear" 启用线性相机姿态插值
    • --vis viewer+tensorboard 启用查看器和 tensorboard 指标保存
    • deblur-nerf-data 选择 DeblurNerfDataparser
  2. 对于 Deblur-NeRF 真实 数据集,使用 downscale_factor=4 训练:

    ns-train bad-gaussians \ --data data/real_camera_motion_blur/blurdecoration \ --pipeline.model.camera-optimizer.mode "cubic" \ --vis viewer+tensorboard \ deblur-nerf-data \ --downscale_factor 4

    其中

    • --pipeline.model.camera-optimizer.mode "cubic" 启用三次 B 样条;
    • --downscale_factor 4deblur-nerf-data 之后告诉 DeblurNerfDataparser 将图像的宽度和高度缩小到原始的 1/4
  3. 对于 Deblur-NeRF 真实 数据集,使用全分辨率训练:

    ns-train bad-gaussians \ --data data/real_camera_motion_blur/blurdecoration \ --pipeline.model.camera-optimizer.mode "cubic" \ --pipeline.model.camera-optimizer.num_virtual_views 15 \ --pipeline.model.num_downscales 2 \ --pipeline.model.resolution_schedule 3000 \ --vis viewer+tensorboard \ deblur-nerf-data

    其中

    • --pipeline.model.camera-optimizer.mode "cubic" 启用三次 B 样条;
    • --pipeline.model.camera-optimizer.num_virtual_views 15 将虚拟相机数量增加到 15;
    • --pipeline.model.num_downscales 2--pipeline.model.resolution_schedule 3000 启用粗到细训练。
  4. 对于使用 ns-process-data 处理的自定义数据,使用以下命令训练:

    ns-train bad-gaussians \ --data data/my_data/blurtanabata \ --vis viewer+tensorboard \ nerfstudio-data --eval_mode "all"

    注意:为了提高自定义数据集的重建质量,你可能需要添加一些参数以启用三次 B 样条更多虚拟相机粗到细训练,如上面的示例所示。

4. 渲染视频

此命令将生成一个轨迹,使用训练图像的相机姿态,保持它们的原始顺序,在相邻图像之间插入 10 帧,帧率为 30。它将加载 config.yml 并将视频保存到 renders/<your_filename>.mp4

ns-render interpolate \ --load-config outputs/blurtanabata/bad-gaussians/<your_experiment_date_time>/config.yml \ --pose-source train \ --frame-rate 30 \ --interpolation-steps 10 \ --output-path renders/<your_filename>.mp4

注意1:你可以添加 --render-nearest-camera True 选项来与模糊的输入进行比较,但这会显著降低渲染速度。

注意2:执行此命令时的工作目录必须是 outputs 的父目录,即与训练时相同的目录。

注意3:你可以在 nerfstudio 文档 中找到更多关于这个命令的信息。

5. 导出3D高斯分布

此命令将加载 config.yml 并在同一文件夹中导出 splat.ply

ns-export gaussian-splat \ --load-config outputs/blurtanabata/bad-gaussians/<你的实验日期时间>/config.yml \ --output-dir outputs/blurtanabata/bad-gaussians/<你的实验日期时间>

注意1:我们默认使用 rasterize_mode = antialiased。但是,如果你想导出3D高斯分布,由于大多数3D-GS查看器不支持 antialiased 模式(即 Mip-Splatting),最好在训练时使用以下命令关闭它:--pipeline.model.rasterize_mode "classic"

注意2:执行此命令时的工作目录必须是 outputs 的父目录,即与训练时相同的目录。

然后你可以使用任何查看器来可视化这个文件,例如 WebGL 查看器

6. 使用IDE进行调试

用你的IDE打开这个仓库,创建一个配置,并将执行的Python脚本路径设置为 <nerfstudio_路径>/nerfstudio/scripts/train.py,并使用上述参数。

引用

如果你觉得这个工作有用,请考虑引用:

@article{zhao2024badgaussians, title={Bad-gaussians: Bundle adjusted deblur gaussian splatting}, author={Zhao, Lingzhe and Wang, Peng and Liu, Peidong}, journal={arXiv preprint arXiv:2403.11831}, year={2024} }

致谢

  • 感谢 Nerfstudiogsplat 的贡献者们的出色工作:

    @inproceedings{nerfstudio, title = {Nerfstudio: A Modular Framework for Neural Radiance Field Development}, author = { Tancik, Matthew and Weber, Ethan and Ng, Evonne and Li, Ruilong and Yi, Brent and Kerr, Justin and Wang, Terrance and Kristoffersen, Alexander and Austin, Jake and Salahi, Kamyar and Ahuja, Abhik and McAllister, David and Kanazawa, Angjoo }, year = 2023, booktitle = {ACM SIGGRAPH 2023 Conference Proceedings}, series = {SIGGRAPH '23} } @software{Ye_gsplat, author = {Ye, Vickie and Turkulainen, Matias, and the Nerfstudio team}, title = {{gsplat}}, url = {https://github.com/nerfstudio-project/gsplat} } @misc{ye2023mathematical, title={Mathematical Supplement for the $\texttt{gsplat}$ Library}, author={Vickie Ye and Angjoo Kanazawa}, year={2023}, eprint={2312.02121}, archivePrefix={arXiv}, primaryClass={cs.MS} }
  • 感谢 pypose 的贡献者们的出色库:

    @inproceedings{wang2023pypose, title = {{PyPose}: A Library for Robot Learning with Physics-based Optimization}, author = {Wang, Chen and Gao, Dasong and Xu, Kuan and Geng, Junyi and Hu, Yaoyu and Qiu, Yuheng and Li, Bowen and Yang, Fan and Moon, Brady and Pandey, Abhinav and Aryan and Xu, Jiahe and Wu, Tianhao and He, Haonan and Huang, Daning and Ren, Zhongqiang and Zhao, Shibo and Fu, Taimeng and Reddy, Pranay and Lin, Xiao and Wang, Wenshan and Shi, Jingnan and Talak, Rajat and Cao, Kun and Du, Yi and Wang, Han and Yu, Huai and Wang, Shanzhao and Chen, Siyu and Kashyap, Ananth and Bandaru, Rohan and Dantu, Karthik and Wu, Jiajun and Xie, Lihua and Carlone, Luca and Hutter, Marco and Scherer, Sebastian}, booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, year = {2023} }

编辑推荐精选

博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

AI办公办公工具AI工具博思AIPPTAI生成PPT智能排版海量精品模板AI创作热门
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

iTerms

iTerms

企业专属的AI法律顾问

iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。

SimilarWeb流量提升

SimilarWeb流量提升

稳定高效的流量提升解决方案,助力品牌曝光

稳定高效的流量提升解决方案,助力品牌曝光

Sora2视频免费生成

Sora2视频免费生成

最新版Sora2模型免费使用,一键生成无水印视频

最新版Sora2模型免费使用,一键生成无水印视频

Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
商汤小浣熊

商汤小浣熊

最强AI数据分析助手

小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。

imini AI

imini AI

像人一样思考的AI智能体

imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。

下拉加载更多