17做网站广州,简述网站的建设流程图,网站开发雇佣平台,兰州网站公司参考#xff1a; 【深度学习】【三维重建】windows11环境配置tiny-cuda-nn详细教程nerfstudio介绍及在windows上的配置、使用NeRFStudio官网githubRuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory原因及解决 目录 requireme… 参考 【深度学习】【三维重建】windows11环境配置tiny-cuda-nn详细教程nerfstudio介绍及在windows上的配置、使用NeRFStudio官网githubRuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory原因及解决 目录 requirements一、创建环境二、安装依赖1.安装pytorch2.安装tiny-cuda-nn3.安装nerfstudio 三、训练模型四、加载预训练模型五、导出结果1.渲染视频2.生成点云3.生成网格4.对比一下 requirements
cuda 11.811.5以上 conda python 3.8 3.8 cmake visual studio 2019/2022
一、创建环境
anaconda prompt中创建conda环境
conda create --name nerfstudio -y python3.8
conda activate nerfstudio
pip install --upgrade pip二、安装依赖
1.安装pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu1182.安装tiny-cuda-nn
按照官方文档上的方法执行会报错找了一个教程安装https://blog.csdn.net/yangyu0515/article/details/131959907#comments_29299437 照着这个教程的【直接下载推荐】那里开始安装就可以了。
3.安装nerfstudio
简单的选择
pip install nerfstudio或者如果您想要最新和最好的
git clone https://github.com/nerfstudio-project/nerfstudio.git
cd nerfstudio
pip install --upgrade pip setuptools
pip install -e .三、训练模型 下载kitchen测试集解压缩并将其拷贝到nerfstudio的data/nerfstudio目录下data/nerfstudio需自己创建;https://drive.google.com/drive/folders/19TV6kdVGcmg3cGZ1bNIUnBBMD-iQjRbG 官网也提供了下载模型的方法 # Download some test data:
ns-download-data nerfstudio --capture-nameposter
# Train model
ns-train nerfacto --data data/nerfstudio/poster# Train model
ns-train nerfacto --data data/nerfstudio/posterkitchen目录下已有transforms.json,若是自己拍摄的图像序列如lego则执行如下命令生成transforms.json
ns-process-data images --data data/nerfstudio/lego/train --output-dir data/nerfstudio/lego --camera-type perspective --matching-method exhaustive --sfm-tool colmap --crop-factor 0.0 0.0 0.0 0.0执行如下命令进行训练迭代产生的checkpoint存储在outputs/kitchen/nerfacto目录下
ns-train nerfacto --data data/nerfstudio/kitchen --vis viewer --max-num-iterations 50000在第一次执行训练命令的时候我报错了PytorchStreamReader failed reading zip archive: failed finding central 解决方法如下我估计是因为之前网络不好啥的导致下载的权重文件有点问题所以找到 C:\Users\Administrator.cache\torch\hub\checkpoints\alexnet-owt-7be5be79.pth 将其删除。重新执行后问题解决。 训练进度如下图所示 可视化效果
四、加载预训练模型
可以加载预训练模型如下命令所示这将自动开始继续训练
ns-train nerfacto --data data/nerfstudio/kitchen --load-dir outputs/kitchen/nerfacto/2024-01-02_164443/nerfstudio_models可以加载预训练模型进行可视化查看
ns-viewer --load-config outputs/kitchen/nerfacto/2024-01-02_174829/config.yml每个命令都有很多参数可以通过–help查看具体支持哪些参数及参数的用处如
ns-render --help
ns-train --help
ns-train nerfacto --help五、导出结果
获得 NeRF 模型后您可以渲染视频或导出点云。
1.渲染视频 导出方法如图 执行代码
ns-render camera-path --load-config outputs\kitchen\nerfacto\2024-01-02_174829/config.yml --camera-path-filename data\nerfstudio\kitchen/camera_paths/2024-01-02_174829.json --output-path renders/data\nerfstudio\kitchen/2024-01-02_174829.mp4渲染视频 nerfstudio渲染视2024-01-02_174829 2.生成点云 在可视化web上面我们可以选择导出点云的配置并复制command进行导出
ns-export pointcloud --load-config outputs\kitchen\nerfacto\2024-01-02_174829/config.yml --output-dir exports/pcd/ --num-points 1000000 --remove-outliers True --normal-method open3d --use-bounding-box True --bounding-box-min -1 -1 -1 --bounding-box-max 1 1 13.生成网格
在可视化web上面我们可以选择导出网格的配置并复制command进行导出
ns-export poisson --load-config outputs\kitchen\nerfacto\2024-01-02_174829/config.yml --output-dir exports/mesh/ --target-num-faces 50000 --num-pixels-per-side 2048 --normal-method open3d --num-points 1000000 --remove-outliers True --use-bounding-box True --bounding-box-min -1 -1 -1 --bounding-box-max 1 1 1导出后在exports\mesh中有四个文件 MTL文件是一种包含材质定义的文件格式通常用于与3D模型文件一起使用。MTL是英文Material Library的缩写它存储了模型的材质信息包括颜色、纹理、光照等属性。 4.对比一下
对比一下ply和mesh里点云的区别可以看到ply里面是没有面数据的……