nvdiffrecmc在Windows上的配置及使用

      nvdiffrecmc是NVIDIA研究院开源的项目,源代码地址:https://github.com/NVlabs/nvdiffrecmc,论文为《Shape, Light, and Material Decomposition from Images using Monte Carlo Rendering and Denoising》,使用Monte Carlo渲染和去噪对图像进行形状、光照和材质分解,是对nvdiffrec的扩展,输出是triangle mesh和2D纹理,可直接将输出结果导入游戏引擎中

      Windows上通过Anaconda安装:与nvdiffrec的配置完全一致
      1.安装cuda 11.6
      2.依次执行如下命令:

conda create -n nvdiffrec python=3.9
conda activate nvdiffrec
pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1+cu116 -f https://download.pytorch.org/whl/torch_stable.html
pip install ninja imageio PyOpenGL glfw xatlas gdown
pip install git+https://github.com/NVlabs/nvdiffrast/
pip install --global-option="--no-networks" git+https://github.com/NVlabs/tiny-cuda-nn#subdirectory=bindings/torch
imageio_download_bin freeimage

      3.下载数据集,将Anaconda Powershell Prompt定位到data目录下,执行如下命令:也可根据需要,直接从https://drive.google.com/drive/folders/128yBriW1IG_3NJ5Rp7APSTZsJqdJdfc1 下载

python download_datasets.py

      使用:以lego为例,执行如下命令:比nvdiffrec还耗显存,若显存不够,可减少configs/nerf_lego.json中的batch

python train.py --config configs\nerf_lego.json --display-interval 100

      执行结果如下图所示:

      执行完后会在out/nerf_lego目录下产生一些文件,如下图:我们需要的是mesh目录下产生的6个文件:mesh.obj, mesh,mtl, probe.hdr, texture_kd.png, texture_ks.png, texture_n.png

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值