【Code】Nerf-Studio复现笔记

文章讲述了在Linux和Windows环境中使用NerfStudio进行模型训练的过程,包括环境配置、数据准备、渲染与评估,以及遇到的问题和解决方法。Linux环境报告较少错误,而NerfStudio的简洁性使得每个步骤可以压缩到一个Python文件中。
摘要由CSDN通过智能技术生成

1. Env

The configuration process was smooth on Linux, but there are some problems with tiny_cuda_nn and colmap in Windows.

// According to the installation document
conda create --name nerfstudio -y python=3.8
conda activate nerfstudio
python -m pip install --upgrade pip

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

pip install nerfstudio
git clone https://github.com/nerfstudio-project/nerfstudio.git
cd nerfstudio
pip install --upgrade pip setuptools
pip install -e .

// Optional
ns-install-cli
pip install -e .[dev]
pip install -e .[docs]

2. Train

The nerfacto was the model recommended to train, but I use Gaussian Splatting, just a small difference.

  1. Prepare the dataset

    ns-download-data nerfstudio --capture-name=poster
    

    We can see the index as follows:

    请添加图片描述

  2. Training

    1. Install gsplat

      pip install gsplat
      
    2. Only need to change the model’s name in rendering.

      ns-train splatfacto --data data/nerfstudio/poster
      
    3. Process:

      We can see the rendering of the web page window and the output of the terminal:

      请添加图片描述
      请添加图片描述

    4. Result

      We can obtain this index structure:
      请添加图片描述

I also do some rendering and eval in the next part of custom data.

3. Custom data

3.1 Prepare

// Installation of colmap
conda install -c conda-forge colmap
colmap -h // To check

// Preprocess the data
ns-process-data images --data /home/Github_project/nerfstudio/Custom_date/Bear --output-dir /home/Github_project/nerfstudio/Custom_date/Bear2

// Small Bug:
// Could not find ffmpeg. Please install ffmpeg.
// See https://ffmpeg.org/download.html for installation instructions.
// Solution
// sudo apt install ffmpeg

If the process goes well, it will show as below:
请添加图片描述

Bug solution:

A small question I have is Error running command: colmap vocab_tree_matcher --database_path (Github #issue). But I just rerun the code the next day. It disappears. I guess we can try to delete the "/home/ubuntu/.local/share/nerfstudio" and restart the computer.

The train process is the same:

ns-train splatfacto --data data/Custom_data

3.2 Render and eval

We can set the keyframes on the viewer and generate the rendering instructions. Then run it, we will obtain the video.
请添加图片描述

And we can use this instruction below to eval:

ns-eval --load-config=outputs/Bear/splatfacto/2024-04-08_193703/config.yml --output-path=output.json

请添加图片描述

3.3 Results

The first dataset is around two bears. PSNR before is okay, but the video is not very good. There are a lot of floating objects

Another drone dataset:

Due to the shooting angle, only part of the overall scene can be seen. But it offers better clarity compared to previous large-scale renderings based on NeRF.

4. Summary

Linux reports much fewer errors than windows. And nerfstudio is very concise. Each method can be compressed into one python file.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值