GithubHelp home page GithubHelp logo

sjtuytc / unboundednerfpytorch Goto Github PK

View Code? Open in Web Editor NEW
1.3K 45.0 119.0 81.3 MB

State-of-the-art, simple, fast unbounded / large-scale NeRFs.

License: MIT License

Python 92.66% C++ 1.57% Cuda 4.44% Shell 1.34%
nerf pytorch-implementation block-nerf view-synthesis weekly-nerf classified pytorch chinese-translation deep-learning unbounded

unboundednerfpytorch's Introduction

Unbounded Neural Radiance Fields in Pytorch

All Contributors

1. Introduction

This is still a research project in progress.

This project aims for benchmarking several state-of-the-art large-scale radiance fields algorithms. We exchangely use terms "unbounded NeRF" and "large-scale NeRF" because we find the techniques behind them are closely related.

Instead of pursuing a big and complicated code system, we pursue a simple code repo with SOTA performance for unbounded NeRFs.

You are expected to get the following results in this repository:

Benchmark Methods PSNR
Unbounded Tanks & Temples NeRF++ 20.49
Unbounded Tanks & Temples Plenoxels 20.40
Unbounded Tanks & Temples DVGO 20.10
Unbounded Tanks & Temples Ours 20.85
Mip-NeRF-360 Benchmark NeRF 24.85
Mip-NeRF-360 Benchmark NeRF++ 26.21
Mip-NeRF-360 Benchmark Mip-NeRF-360 28.94
Mip-NeRF-360 Benchmark DVGO 25.42
Mip-NeRF-360 Benchmark Ours 28.98
Expand / collapse qualitative results.

Tanks and Temples:

  • Playground:
best_ours_playground.mp4
  • Truck:
truck_6_ours.mp4
  • M60:
m60_baseline.mp4
  • Train:
train_2_init_ours.mp4

Mip-NeRF-360 Benchmark:

  • Bicycle:
2_ours.mp4
  • Stump:
stump_4_ours.mp4
  • Kitchen:
2_kitchen.mp4
  • Bonsai:
2_ours.mp4
  • Garden:
2_ours.mp4
  • Counter:
counter_2.mp4
  • Room:
9_almost_ok.mp4

San Francisco Mission Bay (dataset released by Block-NeRF):

  • Training splits:

    oct2_124_300_frames_trim.mp4
  • Rotation:

    rotation.mov

Hope our efforts could help your research or projects!

2. News

  • [2023.3.20] This project is renamed to "UnboundedNeRFPytorch" because we find our work is not large enough (e.g., at city level), rigorously speaking.
Expand / collapse older news.
  • [2023.2.27] A major update of our repository with better performance and full code release.
  • [2022.12.23] Released several weeks' NeRF. Too many papers pop out these days so the update speed is slow.
  • [2022.9.12] Training Block-NeRF on the Waymo dataset, reaching PSNR 24.3.
  • [2022.8.31] Training Mega-NeRF on the Waymo dataset, loss still NAN.
  • [2022.8.24] Support the full Mega-NeRF pipeline.
  • [2022.8.18] Support all previous papers in weekly classified NeRF.
  • [2022.8.17] Support classification in weekly NeRF.
  • [2022.8.16] Support evaluation scripts and data format standard. Getting some results.
  • [2022.8.13] Add estimated camera pose and release a better dataset.
  • [2022.8.12] Add weekly NeRF functions.
  • [2022.8.8] Add the NeRF reconstruction code and doc for custom purposes.
  • [2022.7.28] The data preprocess script is finished.
  • [2022.7.20] This project started!

3. Installation

Expand / collapse installation steps.
  1. Clone this repository. Use depth == 1 to avoid download a large history.

    git clone --depth=1 [email protected]:sjtuytc/LargeScaleNeRFPytorch.git
    mkdir data
    mkdir logs
  2. Create conda environment.

    conda create -n large-scale-nerf python=3.9
    conda activate large-scale-nerf
  3. Install pytorch and other libs. Make sure your Pytorch version is compatible with your CUDA.

    pip install --upgrade pip
    conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia
    pip install -r requirements.txt
  4. Install grid-based operators to avoid running them every time, cuda lib required. (Check via "nvcc -V" to ensure that you have a latest cuda.)

    apt-get install g++ build-essential  # ensure you have g++ and other build essentials, sudo access required.
    cd FourierGrid/cuda
    python setup.py install
    cd ../../
  5. Install other libs used for reconstructing custom scenes. This is only needed when you need to build your scenes.

    sudo apt-get install colmap
    sudo apt-get install imagemagick  # required sudo accesss
    conda install pytorch-scatter -c pyg  # or install via https://github.com/rusty1s/pytorch_scatter

    You can use laptop version of COLMAP as well if you do not have access to sudo access on your server. However, we found if you do not set up COLMAP parameters properly, you would not get the SOTA performance.

4. Unbounded NeRF on the public datasets

Click the following sub-section titles to expand / collapse steps.

4.1 Download processed data.
  • Disclaimer: users are required to get permission from the original dataset provider. Any usage of the data must obey the license of the dataset owner.

(1) Unbounded Tanks & Temples. Download data from here. Then unzip the data.

cd data
gdown --id 11KRfN91W1AxAW6lOFs4EeYDbeoQZCi87
unzip tanks_and_temples.zip
cd ../

(2) The Mip-NeRF-360 dataset.

cd data
wget http://storage.googleapis.com/gresearch/refraw360/360_v2.zip
mkdir 360_v2
unzip 360_v2.zip -d 360_v2
cd ../

(3) San Fran Cisco Mission Bay. What you should know before downloading the data:

  • Our processed waymo data is significantly smaller than the original version (19.1GB vs. 191GB) because we store the camera poses instead of raw ray directions. Besides, our processed data is more friendly for Pytorch dataloaders. Download the data in the Google Drive. You may use gdown to download the files via command lines. If you are interested in processing the raw waymo data on your own, please refer to this doc.

The downloaded data would look like this:

data
   |
   |——————360_v2                                    // the root folder for the Mip-NeRF-360 benchmark
   |        └——————bicycle                          // one scene under the Mip-NeRF-360 benchmark
   |        |         └——————images                 // rgb images
   |        |         └——————images_2               // rgb images downscaled by 2
   |        |         └——————sparse                 // camera poses
   |        ...
   |——————tanks_and_temples                         // the root folder for Tanks&Temples
   |        └——————tat_intermediate_M60             // one scene under Tanks&Temples
   |        |         └——————camera_path            // render split camera poses, intrinsics and extrinsics
   |        |         └——————test                   // test split
   |        |         └——————train                  // train split
   |        |         └——————validation             // validation split
   |        ...
   |——————pytorch_waymo_dataset                     // the root folder for San Fran Cisco Mission Bay
   |        └——————cam_info.json                    // extracted cam2img information in dict.
   |        └——————coordinates.pt                   // global camera information used in Mega-NeRF, deprecated
   |        └——————train                            // train data
   |        |         └——————metadata               // meta data per image (camera information, etc)
   |        |         └——————rgbs                   // rgb images
   |        |         └——————split_block_train.json // split block informations
   |        |         └——————train_all_meta.json    // all meta informations in train folder
   |        └——————val                              // val data with the same structure as train
4.2 Train models and see the results!

You only need to run "python run_FourierGrid.py" to finish the train-test-render cycle. Explanations of some arguments:

--program: the program to run, normally --program train will be all you need.
--config: the config pointing to the scene file, e.g., --config FourierGrid/configs/tankstemple_unbounded/truck_single.py.
--num_per_block: number of blocks used in large-scale NeRFs, normally this is set to -1, unless specially needed.
--render_train: render the trained model on the train split.
--render_train: render the trained model on the test split.
--render_train: render the trained model on the render split.
--exp_id: add some experimental ids to identify different experiments. E.g., --exp_id 5.
--eval_ssim / eval_lpips_vgg: report SSIM / LPIPS(VGG) scores.

While we list major of the commands in scripts/train_FourierGrid.sh, we list some of commands below for better reproducibility.

# Unbounded tanks and temples
python run_FourierGrid.py --program train --config FourierGrid/configs/tankstemple_unbounded/playground_single.py --num_per_block -1 --render_train --render_test --render_video --exp_id 57
python run_FourierGrid.py --program train --config FourierGrid/configs/tankstemple_unbounded/train_single.py --num_per_block -1 --render_train --render_test --render_video --exp_id 12
python run_FourierGrid.py --program train --config FourierGrid/configs/tankstemple_unbounded/truck_single.py --num_per_block -1 --render_train --render_test --render_video --exp_id 4
python run_FourierGrid.py --program train --config FourierGrid/configs/tankstemple_unbounded/m60_single.py --num_per_block -1 --render_train --render_test --render_video --exp_id 6

# 360 degree dataset
python run_FourierGrid.py --program train --config FourierGrid/configs/nerf_unbounded/room_single.py --num_per_block -1 --eval_ssim --eval_lpips_vgg --render_train --render_test --render_video --exp_id 9
python run_FourierGrid.py --program train --config FourierGrid/configs/nerf_unbounded/stump_single.py --num_per_block -1 --eval_ssim --eval_lpips_vgg --render_train --render_test --render_video --exp_id 10
python run_FourierGrid.py --program train --config FourierGrid/configs/nerf_unbounded/bicycle_single.py --num_per_block -1 --eval_ssim --eval_lpips_vgg --render_train --render_test --render_video --exp_id 11
python run_FourierGrid.py --program train --config FourierGrid/configs/nerf_unbounded/bonsai_single.py --num_per_block -1 --eval_ssim --eval_lpips_vgg --render_train --render_test --render_video --exp_id 3
python run_FourierGrid.py --program train --config FourierGrid/configs/nerf_unbounded/garden_single.py --num_per_block -1 --eval_ssim --eval_lpips_vgg --render_train --render_test --render_video --exp_id 2
python run_FourierGrid.py --program train --config FourierGrid/configs/nerf_unbounded/kitchen_single.py --num_per_block -1 --eval_ssim --eval_lpips_vgg --render_train --render_test --render_video --exp_id 2
python run_FourierGrid.py --program train --config FourierGrid/configs/nerf_unbounded/counter_single.py --num_per_block -1 --eval_ssim --eval_lpips_vgg --render_train --render_test --render_video --exp_id 2

# San Francisco Mission Bay dataset
python run_FourierGrid.py --program train --config FourierGrid/configs/waymo/waymo_no_block.py --num_per_block 100 --render_video --exp_id 30

The old version of Block-NeRF is still provided to serve as a baseline, but it will be deprecated soon. We will mainly work on grid-based models later because they are simple and fast. Run the following command to reproduce the old Block-NeRF experiments:

bash scripts/block_nerf_train.sh
bash scripts/block_nerf_eval.sh

5. Build your custom unbounded NeRF (deprecated)

Expand / collapse steps for building custom NeRF world.
  1. Put your images under data folder. The structure should be like:

    data
       |——————Madoka          // Your folder name here.
       |        └——————source // Source images should be put here.
       |                 └——————---|1.png
       |                 └——————---|2.png
       |                 └——————---|...

    The sample data is provided in our Google drive folder. The Madoka and Otobai can be found at this link.

  2. Run COLMAP to reconstruct scenes. This would probably cost a long time.

    python FourierGrid/tools/imgs2poses.py data/Madoka

    You can replace data/Madoka by your data folder. If your COLMAP version is larger than 3.6 (which should not happen if you use apt-get), you need to change export_path to output_path in the colmap_wrapper.py.

  3. Training NeRF scenes.

    python FourierGrid/run_FourierGrid.py --config configs/custom/Madoka.py

    You can replace configs/custom/Madoka.py by other configs.

  4. Validating the training results to generate a fly-through video.

    python FourierGrid/run_FourierGrid.py --config configs/custom/Madoka.py --render_only --render_video --render_video_factor 8

6. Citations & acknowledgements

Consider citing the following great works:

@inproceedings{dvgo,
  title={Direct voxel grid optimization: Super-fast convergence for radiance fields reconstruction},
  author={Sun, Cheng and Sun, Min and Chen, Hwann-Tzong},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={5459--5469},
  year={2022}
}

 @InProceedings{Tancik_2022_CVPR,
    author    = {Tancik, Matthew and Casser, Vincent and Yan, Xinchen and Pradhan, Sabeek and Mildenhall, Ben and Srinivasan, Pratul P. and Barron, Jonathan T. and Kretzschmar, Henrik},
    title     = {Block-NeRF: Scalable Large Scene Neural View Synthesis},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2022},
    pages     = {8248-8258}
}

We refer to the code and data from DVGO, nerf-pl and SVOX2, thanks for their great work!

We track weekly NeRF papers and classify them. All previous published NeRF papers have been added to the list. We provide an English version and a Chinese version. We welcome contributions and corrections via PR.

We also provide an excel version (the meta data) of all NeRF papers, you can add your own comments or make your own paper analysis tools based on the structured meta data.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Zelin Zhao
Zelin Zhao

💻 🚧
EZ-Yang
EZ-Yang

💻
Alex-Zhang
Alex-Zhang

🐛
Fan Lu
Fan Lu

🐛
MaybeShewill-CV
MaybeShewill-CV

🐛
buer1121
buer1121

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

unboundednerfpytorch's People

Contributors

allcontributors[bot] avatar maybeshewill-cv avatar sjtuytc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unboundednerfpytorch's Issues

深度图无法直接合成视频

eval_block_nerf.py里面,depth_video_writer.write(Depth_compose['compose']),直接将1通道的深度图写入视频,我发现结果视频都没法播放,好像是因为cv2.VideoWriter没法直接将1通道的图片合成视频,需要先转为3通道,所以我在前面加了Depth_compose['compose'] = cv2.cvtColor(Depth_compose['compose'],cv2.COLOR_GRAY2BGR),就可以成功转成视频了。

How to train on pytorch_block_nerf_dataset or convert it to mega-nerf format

Hello, many thanks for your great work!
I found that the pytorch_block_nerf_dataset is not in a format similar to mega-nerf. I don't know whether this dataset could be directly used for training by your codes. Could you provide several hands-on commands for that? If it could not be directly trained, could you give some hints on how to convert it to mega-nerf format? Thank you very much!

About waymo dataset download

Thanks for your great work! Could you please provide google drive links for waymo dataset, because I cannot download it with 'gdown --id". Thanks in advance!

PSNR is not finite when training on waymo

Hi, many thanks for your efforts in these works!
I run the training code on the waymo dataset following your instructions and modified some configuration to save the CPU and GPU memory (chunk size 100, batch size 512). However, a problem arises that the training metrics are not finite and a debugging process stops the training code.

In Pdb, the dictionary metric contains four key-value pair, i.e., psnr, depth_variance, photo_loss and loss, but their values are all nan. And the values item['rgbs'] and item['rays] seem proper.

image
image
image

Looking forward to your reply! Thank you at advance!

About training on waymo dataset

Hi, Thanks for your great works!
I have downloaded your preprocessed waymo dataset pytorch_block_nerf_data.zip and run the code to generate the masks for training following your instructions. However, the code throw an error about missing corrdinate.pt. Could you give some advice about this problem? Is the official waymo dataset necessary for training?
Looking forward to your reply.
Thanks.

rendering_video error

when i generate a fly-through video it make success, but when i download it and open cause file damage? I dont know what's wrong, could you help me?

No module named 'block_nerf.rendering'

hi, thanks for this great work for large scene.
I'm a Chinese college student, when I want to reproduce your block-nerf, run "bash scripts/block_nerf_eval.sh" and say "No module named block_nerf.rendering", there is really no rendering.py under block-nerf, didn't you put it up?

Some error when I eval the pretrained models

Hi, First of all thank you for your great work.
When I was about to train the block-nerf model on my own data set, I followed your advice and validated it on the data set you provided and the pre-training model, but when I ran: bash scripts/block_nerf_eval.sh. The following error occurs:
image
I check the block_nerf file in the project, I do not find related function, including block_nerf_model、block_nerf_lightning. I guess there is something wrong with the environment. Can you help me? Thanks.

About Waymo's pose

After visualize the waymo's training pose, here we can see, y axis is the car driving direction. If in my dataset z axis is the car driving direction, do I need transform the pose same as waymo training pose?

image

custom dataset preparation

The existing NeRF papers illustrated that we can use COLMAP to generate transform.json file. However, it comes with a condition that there should be 70% overlap with each images.

In Block-NeRF, they mentioned that image data captured from 12 cameras that collectively provide a 360° view. 8 of the cameras provide a complete surround view from the roof of the car, with 4 additional cameras located at the vehicle front pointing forward and sideways.

Would it be possible to share the piece of code that used those 12 camera images as input to generate a transform.json ?

Many thanks.

Questions about near and far plane in block nerf

Thanks for great work! I once used waymo open dataset for blocknerf to reconstruct city scene. However it shows that there is no near and far plane information in its dataset, which seems necessary in training nerf model. I wonder how to deal with it.

Preparing data for training from existing colmap model

Hi, I have an existing city-scale (1km by 1km) colmap model of 20'000 grayscale images with well refined poses. I am a bit lost on how to train using this data.

How do I convert this into the format required for training? I have cameras.bin, images.bin, points3D.bin and the corresponding images. Additionally, what config file do you recommend for such a scenario? Finally, I suspect not, but does this project support sparse depth supervision?

"ERROR: the correct camera poses for current points cannot be accessed"

作者,你好
我用自采数据生成Block_nerf的训练数据,遇到下面问题。用github上面的sample data,就不会出现。
采用这个脚本 python tools/imgs2poses.py data/front_left

Undistorting image [1/2]
Undistorting image [2/2]
Writing reconstruction...
Writing configuration...
Writing scripts...
Elapsed time: 0.004 [minutes]
Undistort images
Finished running COLMAP! Congrats!
Post-colmap
Cameras 5
Images # 2
ERROR: the correct camera poses for current points cannot be accessed
Factors: [2, 4, 8]
Minifying 2 data/front_left/dense
mogrify -resize 50% -format png *.png
Done
Minifying 4 data/front_left/dense
mogrify -resize 25% -format png *.png
Done
Minifying 8 data/front_left/dense
mogrify -resize 12% -format png *.png
Done
Done with imgs2poses

Problem when run bash scripts/block_nerf_eval.sh

问题1:ModuleNotFoundError: No module named 'block_nerf.block_nerf_lightning'
问题2:将block_nerf.block_nerf_lightning用到的地方注释后会提示
block_nerf/block_nerf_model.py", line 20, in init
self.loss = BlockNeRFLoss(1e-2) # hparams['Visi_loss']
NameError: name 'BlockNeRFLoss' is not defined

请问:block_nerf是还缺少依赖文件吗,感谢您的后续解答

hello,Ask questions!

Hello! I am also recently trying to replicate Block-NeRF and have built the most basic network architecture, including merging Mip-NeRF with NeRF-Wild, and got good results, here is my email: [email protected], if interested you can email me and I will my current progress

Training anomalies exist

hi,Thanks for your excellent work, but I get stuck in some places when I train the module, when the video memory is occupied, but no gpu is called to participate in the calculation, I don't know how to deal with this situation, I hope you can give some advice
9-1
.

您好,我想了解位姿优化部分具体是怎么做的,谢谢。

之前我们讨论是借鉴nerf--来做位姿优化。但我有两个问题:
1.如何处理大场景的位姿优化,因为汽车行驶过程中,可能后期见到的画面和之前的图像没有任何形似点。
2.怎么更好地利用视频序列来做位姿优化。
谢谢您的工作!

自制的数据集在运行python run.py时出错

您好,我在自制数据集运行时出现了一些问题,想跟您请教一下。

背景:
我是在实验室内拍摄了实验室一周(包括两排桌椅、电脑以及天花板、地板)照片,有水平移动拍摄的、有俯拍和仰拍的,也有环绕着拍摄的,一共411张图。
对于拍摄的图片,利用colmap保存了database.db,然后进行了特征提取、特征匹配以及稀疏重建,最后Export model将其保存在"sparse/0/"文件夹下。
利用Fyusion/LLFF将导出的位姿数据转换成llff数据格式,由于照片数(411)和实际在colmap注册的数量(401)不匹配,因此出现了ERROR: the correct camera poses for current points cannot be accessed 这个错误,利用Fyusion/LLFF#60 (comment) 解决了问题,得到了poses_bounds.npy,并删掉了colmap未注册的照片。

问题:
运行 python run.py --config configs/custom/room.py 时,报错如下:

Loading images from data/room/dense/images_2
Loaded image data (2880, 1620, 3, 401) [2880. 1620. 2119.14228993]
Loaded data/room/dense 8.725662744276601e-10 38.88514969557468
recentered (3, 5)
[[ 1.0000000e+00 7.9511068e-08 7.2999038e-09 -8.4269325e+01]
[-7.9511068e-08 1.0000000e+00 -1.7426238e-07 3.5367581e+02]
[-7.2999176e-09 1.7426238e-07 1.0000000e+00 -1.4172569e+02]]
/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/lib/load_llff.py:409: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at /opt/conda/conda-bld/pytorch_1634272204863/work/torch/csrc/utils/tensor_new.cpp:201.)
render_poses = torch.Tensor(render_poses)
Data:
(401, 3, 5) (401, 2880, 1620, 3) (401, 2)
HOLDOUT view is 214
Loaded llff (401, 2880, 1620, 3) torch.Size([120, 3, 5]) [2880. 1620. 2119.1423] data/room/dense
DEFINING BOUNDS
NEAR FAR 0.0 1.0
train: start
compute_bbox_by_cam_frustrm: start
/home/vcis6/anaconda3/envs/mega-nerf/lib/python3.9/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1634272204863/work/aten/src/ATen/native/TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
compute_bbox_by_cam_frustrm: xyz_min tensor([nan, nan, nan])
compute_bbox_by_cam_frustrm: xyz_max tensor([nan, nan, nan])
compute_bbox_by_cam_frustrm: finish
train: skip coarse geometry searching
scene_rep_reconstruction (fine): train from scratch
scene_rep_reconstruction (fine): use multiplane images
dmpigo: world_size tensor([-9223372036854775808, -9223372036854775808, 256])
dmpigo: voxel_size_ratio 1.0
Traceback (most recent call last):
File "/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/run.py", line 630, in
train(args, cfg, data_dict)
File "/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/run.py", line 562, in train
scene_rep_reconstruction(
File "/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/run.py", line 328, in scene_rep_reconstruction
model, optimizer = create_new_model(cfg, cfg_model, cfg_train, xyz_min, xyz_max, stage, coarse_ckpt_path)
File "/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/run.py", line 266, in create_new_model
model = dmpigo.DirectMPIGO(
File "/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/lib/dmpigo.py", line 41, in init
self.density = grid.create_grid(
File "/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/lib/grid.py", line 29, in create_grid
return DenseGrid(**kwargs)
File "/home/vcis6/Userlist/Zouchen/LargeScaleNeRFPytorch/lib/grid.py", line 45, in init
self.grid = nn.Parameter(torch.zeros([1, channels, *world_size]))
RuntimeError: Trying to create tensor with negative dimension -9223372036854775808: [1, 1, -9223372036854775808, -9223372036854775808, 256]

(在这之前,我在单个方向拍了38张照片,然后利用上面相同的步骤,可以顺利生成模型以及视频)

Splitting data with known camera pose into seperate blocks

I'm trying to generate a Block-NeRF with my own data

How would you proceed if you were to split your own data into separate blocks, in order to train them with train_block_nerf.py? split_block.py can't run on custom data because of lacking files such as train_all_meta.pt and split_block_train.json which are included in Waymo's data. Is there a way to generate these required files?

No such file or directory: coordinates.pt

Hello ,I'm a student from HUST . Recently I'm running Mega-NeRF on Waymo Dataset and trying to do some experiments. Knowing that this project have finished the task ,so I try to running the program on this code hub. Unfortunately ,the script callback a error explained that No such file or directory.
I think I follow the correct steps ,firstly I download the Waymo dataset ,and run the script get_one_block_meta_and_visualize.py and split_block.py.I found the file coordinate.pt do not exists exactly .I'm confused , I don't know what step is wrong. Can you help me?

Traceback (most recent call last):
  File "create_cluster_masks.py", line 214, in <module>
    main(_get_mask_opts())
  File "/environment/miniconda3/lib/python3.7/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 345, in wrapper
    return f(*args, **kwargs)
  File "/environment/miniconda3/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
  File "create_cluster_masks.py", line 57, in main
    coordinate_info = torch.load(dataset_path / 'coordinates.pt', map_location='cpu')
  File "/environment/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 594, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/environment/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/environment/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '~/data/data/pytorch_waymo_dataset/coordinates.pt'

misleading contents

I think the major part of this project is only a copy of Mega-NeRF. While in the code and README, this repo uses BlockNeRF and claims it supports BlockNeRF, which is actually not true and can be misleading to others. I think this issue should be fixed.

训练自己的数据时config参数如何设置

非常感谢大佬的无私分享。想训练自己的数据,但不知到config要怎么写,下面是configs/custom/Otobai.py的一部分,大佬能给点指导吗?感谢,感谢
factor=2,
movie_render_kwargs={
'scale_r': 0.8,
'scale_f': 10.0,
'zrate': 6.0,
'zdelta': 0.5,
}

Is Block-NeRF amenable to instant-ngp optimizations?

Nvidia has published instant-ngp, a refinement of the NeRF algorithm that allows for training times 2-3 orders of magnitude faster than traditional NeRFs.

Could Block-NeRF be adapted to use the same optimizations? My iteration speed would be much faster if it didn't take hours-days every time I wanted to experiment with a new set of collections! 😃

About the intrinsics of Block-Nerf

Hello,
Thanks for your effort for reproducing Block-Nerf.
I use the scripts in fetch_data_from_tf_record.py to generate dataset for Block-Nerf. I observed that you use the proposed intrinsics to generate rays in camera coordinate (Line 133) while the output intrinsics (fx, fy) are the provided intrinsics + [W/2, H/2] (Line 145). It is confusing and could you explain it for me?

Thanks again.

Problem when run bash scripts/block_nerf_eval.sh

问题提示:
block-nerf/block_nerf/rendering.py", line 19, in get_cone_mean_conv
* mean_t ** 2 - difference_t ** 2) / (3 * mean_t ** 2
UnboundLocalError: local variable 'mean_t' referenced before assignment
image
关于get_cone_mean_conv函数那里确实没有定义mean_t

感谢您的后续解答

improvement of depth info

Hi, do u have any engineering experience for improving the depth training.if the pose is correct, do I need tune the params?

Here i got in own dataset by default setting
image
Here from pretrained model in supported dataset
image

RuntimeError :error building extension 'render_utils_cuda'

I'm running into this problem please ask when the cuda version is not compatible with the problem
图片
this is my configuration:
2080TI,cuda10.1,pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 ( torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2)

How to get a sequential list of training frames per camera (preprocessed waymo dataset)?

I really appreciate for making this repo public!

I was wondering how to get a "sequential" list of trainings per camera (out of 12 cameras).

Here is how I understood the data framework and tried to get a sequential list of images:

  • the data has been preprocessed by globing the original data by its filename (which I assumed to include sequential information).
  • The preprocessing script recorded this globbed sequence using 'index' key in metadata dictionary.
  • Meanwhile, each image is captured from one of 12 cameras, whose index is stored as 'cam_idx' in metadata dictionary.
  • So, I sub-sampled images with same 'cam_idx' per block, and ordered them by 'index'.

This gave me pretty random sequence of images... any hints on retrieving clean sequence as in "oct2_124_300_frames_trim.mp4" video that shows training frames sequentially in the README.md?

Thank you in advance!

academic discussion

About NeRF generalization, as I have tested, if I use block_0 model to inference block_8 dataset, it's hard to get worthy result. So, the nerf model generalization is really like all kinds of references expressed that nerf's generalization is very poor? If we expand the block area, that means to train more data, e.g. treat one city dataset as one block, then the generalization is better or not?

Problem when run waymo dataset.

Hiii I met a weird problem when following your recommended commands. Since I have already downloaded the corresponding dataset from the provided google drive link in this repo, the file structure specified in the load_waymo.py might be different.

When I ran "python run_FourierGrid.py --program train --config FourierGrid/configs/waymo/waymo_no_block.py --num_per_block 100 --render_video --exp_id 30", I got "No such file or directory: 'data/sep19_ordered_dataset/metadata.json'".

However, I don't think a folder called "sep19_ordered_dataset" exists in pytorch_waymo_dataset. Maybe I miss something and I will appreciate it if you could give some advice.
Thanks:)

Big dataset

hi,i have a questions ,how to implement the parallel training and merging function in blocknerf when it needs to run large dataset?

About ray_origins and ray_directions in Waymo raw dataset

Hello, thank you for your great works! I want to try my own data on block-nerf, so I want to create a dataset similar to Waymo Block-NeRF Dataset. May I know that how is ray_origins and ray_directions generated? Is there any method we can get r_o and r_d, if we have pose and camera intrinsics from SLAM?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.