1、instant-ngp(kwea123)代码运行

运行配置

github地址:https://github.com/kwea123/ngp_pl

  1. git拉取代码
git clone https://github.com/kwea123/ngp_pl
  1. 创建环境
conda create -n ngp_pl python=3.8
  1. 工具

make

apt install make

cmake3.18.0

wget https://cmake.org/files/v3.18/cmake-3.18.0-Linux-x86_64.tar.gz
tar zxvf cmake-3.18.0-Linux-x86_64.tar.gz

sudo mv cmake-3.18.0-Linux-x86_64 /usr/local/cmake-3.18.0
sudo ln -sf /usr/local/cmake-3.18.0/bin/*  /usr/bin/
cmake --version
  1. python依赖包

requirement.txt

pip install -r requirement.txt

注:cuda使用11.3版本

torch-scatter

pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+cu113.html

tinycudann

git clone --recursive https://github.com/nvlabs/tiny-cuda-nn
cd tiny-cuda-nn

cmake . -B build
cmake --build build --config RelWithDebInfo -j

pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

cd bindings/torch
python setup.py install

apex

要求cuda11.3

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
  1. cuda extension
    pip 要 >= 22.1

运行下列代码 (please run this each time you pull the code)

 pip install models/csrc/ 

数据

  1. NSVF data

Download preprocessed datasets (Synthetic_NeRF, Synthetic_NSVF, BlendedMVS, TanksAndTemples) from NSVF. Do not change the folder names since there is some hard-coded fix in my dataloader.

  1. NeRF++ data

Download data from here.

  1. Colmap data

For custom data, run colmap and get a folder sparse/0 under which there are cameras.bin, images.bin and points3D.bin. The following data with colmap format are also supported:

  1. nerf_llff_data
  2. mipnerf360 data
  3. HDR-NeRF data. Additionally, download my colmap pose estimation from here and extract to the same location.
  4. RTMV data Download data from here. To convert the hdr images into ldr images for training, run python misc/prepare_rtmv.py , it will create images/ folder under each scene folder, and will use these images to train (and test).

Training

1、instant-ngp(kwea123)代码运行_第1张图片

python train.py --root_dir <path/to/lego> --exp_name Lego

python train.py --root_dir ./data/Synthetic_NeRF/Lego --exp_name Lego

概念

Instant-ngp重要的加速手段:

  1. cuda加速
  2. 多分辨率Hash表位置编码
  3. 体素剪枝辅助样本采样

Instant-ngp
1、instant-ngp(kwea123)代码运行_第2张图片
类似文章:NSVF
1、instant-ngp(kwea123)代码运行_第3张图片
1、instant-ngp(kwea123)代码运行_第4张图片

你可能感兴趣的:(#,3D重建代码运行过程,python,git,开发语言)