TriplaneGaussian 安装与配置指南

TriplaneGaussian 安装与配置指南

TriplaneGaussian TriplaneGaussian: A new hybrid representation for single-view 3D reconstruction. TriplaneGaussian 项目地址: https://gitcode.com/gh_mirrors/tr/TriplaneGaussian

1. 项目基础介绍

TriplaneGaussian 是一个开源项目,它实现了基于单视图图像的快速三维重建。该项目使用了混合的 Triplane-Gaussian 三维表示方法,结合了显式和隐式表示的优点,能够在几秒钟内从单视图图像中生成高质量的三维模型。

主要编程语言:Python

2. 项目使用的关键技术和框架

  • Triplane-Gaussian 表示:一种新的混合三维表示方法。
  • Transformers:使用 Transformer 架构进行图像到三维模型的转换。
  • PyTorch:深度学习框架,用于模型的训练和推理。
  • Gradio:用于创建 Web 应用程序以展示模型的效果。

3. 项目安装和配置准备工作

在开始安装之前,请确保您的系统中已经安装了以下依赖项:

  • Python >= 3.8
  • PyTorch >= 1.12

详细安装步骤

第一步:安装 PyTorch
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
第二步:安装 pointnet2_ops
cd tgs/models/snowflake/pointnet2_ops_lib
&& python setup.py install
&& cd -
第三步:安装 pytorch_scatter
pip install git+https://github.com/rusty1s/pytorch_scatter.git
第四步:安装 diff-gaussian-rasterization
pip install git+https://github.com/graphdeco-inria/diff-gaussian-rasterization.git
第五步:安装项目依赖
pip install -r requirements.txt
第六步:安装 PyTorch3D

按照 PyTorch3D 的官方安装说明进行安装。

第七步:下载预训练模型

从 Hugging Face 下载预训练的模型并放置在 checkpoints 文件夹中。

from huggingface_hub import hf_hub_download
MODEL_CKPT_PATH = hf_hub_download(
    repo_id="VAST-AI/TriplaneGaussian",
    local_dir="./checkpoints",
    filename="model_lvis_rel.ckpt",
    repo_type="model"
)
第八步:运行推理

使用以下命令从单个图像中重建三维模型。请更新 data.image_list 为特定的图像路径。

python infer.py --config config.yaml data.image_list=[path/to/image1,] --image_preprocess --cam_dist ${cam_dist}

例如:

python infer.py --config config.yaml data.image_list=[example_images/a_pikachu_with_smily_face.webp,] --image_preprocess

如果您希望从输入图像中移除背景,可以在命令中开启 --image_preprocess 参数。在此之前,请先下载 SAM 检查点并将其放置在 checkpoints 文件夹中。

请注意,--cam_dist 用于设置相机距离参数,它表示相机中心与场景中心的距离,默认值为 1.9。

最后,该脚本将保存一个视频(.mp4)和一个三维模型文件(.ply)。.ply 文件的格式与 graphdeco-inria/gaussian-splatting 兼容,使其可以与其他可视化工具如 gsplat.js 配合使用。

以上就是 TriplaneGaussian 的安装与配置指南。按照上述步骤操作,您应该能够成功运行该项目并从单视图图像中重建出高质量的三维模型。

TriplaneGaussian TriplaneGaussian: A new hybrid representation for single-view 3D reconstruction. TriplaneGaussian 项目地址: https://gitcode.com/gh_mirrors/tr/TriplaneGaussian

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

范芬蓓

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值