# nerf-pytorch **Repository Path**: Fj1225815367/nerf-pytorch ## Basic Information - **Project Name**: nerf-pytorch - **Description**: mirror of nerf pytorch - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2023-11-14 - **Last Updated**: 2023-11-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NeRF-pytorch [NeRF](http://www.matthewtancik.com/nerf)(神经辐射场)是一种获得最新结果的方法,用于合成复杂场景的新视图。以下是此存储库生成的一些视频(下面提供了预训练模型): ![](https://user-images.githubusercontent.com/7057863/78472232-cf374a00-7769-11ea-8871-0bc710951839.gif) ![](https://user-images.githubusercontent.com/7057863/78472235-d1010d80-7769-11ea-9be9-51365180e063.gif) 该项目是 [NeRF](http://www.matthewtancik.com/nerf)是一个可信任的 PyTorch 实现,它在运行速度提高 1.3 倍的同时重现了结果。该代码基于作者的 Tensorflow 实现 [此处](https://github.com/bmild/nerf),并经过测试以在数值上匹配它。 ## 安装 ``` git clone https://github.com/yenchenlin/nerf-pytorch.git cd nerf-pytorch pip install -r requirements.txt ```
依赖 (单击以展开) ## 依赖包 - PyTorch 1.4 - matplotlib - numpy - imageio - imageio-ffmpeg - configargparse LLFF 数据加载器需要 ImageMagick。 如果您想在自己的真实数据上运行,您还需要设置 [LLFF 代码](http://github.com/fyusion/llff)(和 COLMAP)来计算姿势。
## 怎么运行? ### Quick Start 下载两个示例数据集的数据:“lego”和“fern” ``` bash download_example_data.sh ``` 要训练低分辨率的“lego”NeRF: ``` python run_nerf.py --config configs/lego.txt ``` 训练 100k 迭代(在单个 2080 Ti 上 训练4 小时)后,您可以在“logs/lego_test/lego_test_spiral_100000_rgb.mp4”中找到以下视频。 ![](https://user-images.githubusercontent.com/7057863/78473103-9353b300-7770-11ea-98ed-6ba2d877b62c.gif) --- 要训练低分辨率的“fern”NeRF: ``` python run_nerf.py --config configs/fern.txt ``` 经过 200k 次迭代训练(在单个 2080 Ti 上训练 8 小时)后,您可以在“logs/fern_test/fern_test_spiral_200000_rgb.mp4”和“logs/fern_test/fern_test_spiral_200000_disp.mp4”中找到以下视频 ![](https://user-images.githubusercontent.com/7057863/78473081-58ea1600-7770-11ea-92ce-2bbf6a3f9add.gif) --- ### 更多数据集 要体验论文中介绍的其他场景,请在[此处](https://drive.google.com/drive/folders/128yBriW1IG_3NJ5Rp7APSTZsJqdJdfc1)下载数据。且放置下载的数据集在以下目录结构: ``` ├── configs │   ├── ... │   ├── data │   ├── nerf_llff_data │   │   └── fern │   │  └── flower # downloaded llff dataset │   │  └── horns # downloaded llff dataset | | └── ... | ├── nerf_synthetic | | └── lego | | └── ship # downloaded synthetic dataset | | └── ... ``` --- 在不同的数据集上训练 NeRF: ``` python run_nerf.py --config configs/{DATASET}.txt ``` 用 `trex` | `horns` | `flower` | `fortress` | `lego` | 等等替换 `{DATASET}` . --- 测试在不同数据集上训练的 NeRF: ``` python run_nerf.py --config configs/{DATASET}.txt --render_only ``` 用 `trex` | `horns` | `flower` | `fortress` | `lego` | 等等替换 `{DATASET}`. ### 预训练模型 您可以在[此处](https://drive.google.com/drive/folders/1jIr8dkvefrQmv737fFm2isiT6tqpbTbv)下载预训练模型。将下载的目录放在“./logs”中,以便稍后测试。有关示例,请参阅以下目录结构: ``` ├── logs │   ├── fern_test │   ├── flower_test # downloaded logs │ ├── trex_test # downloaded logs ``` ### 再现性 测试确定在不同的分支 `reproduce`中关于功能和循环训练是和官方实现相匹配的。可以检查它并运行测试: ``` git checkout reproduce py.test ``` ## 方法 [NeRF:将场景表示为用于视图合成的神经辐射场](http://tancik.com/nerf) [Ben Mildenhall](https://people.eecs.berkeley.edu/~bmild/)\*1, [Pratul P. Srinivasan](https://people.eecs.berkeley.edu/~pratul/)\*1, [Matthew Tancik](http://tancik.com/)\*1, [Jonathan T. Barron](http://jonbarron.info/)2, [Ravi Ramamoorthi](http://cseweb.ucsd.edu/~ravir/)3, [Ren Ng](https://www2.eecs.berkeley.edu/Faculty/Homepages/yirenng.html)1
1UC Berkeley, 2Google Research, 3UC San Diego \*奉献相同的贡献 > 一个神经辐射场是一个简单的全连接网络(权重是 ~5MB),这个网络经过训练,可以使用渲染损失来再现一个场景的输入视图。该网络直接从空间位置和观看方向(5D 输入)映射到颜色和不透明度(4D 输出),充当“体积”,因此我们可以使用体积渲染来得到不一样的渲染新视图。 ## 引文 感谢作者的惊人成果: ``` @misc{mildenhall2020nerf, title={NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis}, author={Ben Mildenhall and Pratul P. Srinivasan and Matthew Tancik and Jonathan T. Barron and Ravi Ramamoorthi and Ren Ng}, year={2020}, eprint={2003.08934}, archivePrefix={arXiv}, primaryClass={cs.CV} } ``` 但是,如果您发现此实现或预训练模型有帮助,请考虑引用: ``` @misc{lin2020nerfpytorch, title={NeRF-pytorch}, author={Yen-Chen, Lin}, publisher = {GitHub}, journal = {GitHub repository}, howpublished={\url{https://github.com/yenchenlin/nerf-pytorch/}}, year={2020} } ```