Git Product home page Git Product logo

uc-nerf's Introduction

UC-NeRF: Neural Radiance Field for Under-Calibrated Multi-view Cameras in Autonomous Driving

🖼️ Demo

image

📖 Abstract

Multi-camera setups find widespread use across various applications, such as au- tonomous driving, as they greatly expand sensing capabilities. Despite the fast development of Neural radiance field (NeRF) techniques and their wide applica- tions in both indoor and outdoor scenes, applying NeRF to multi-camera systems remains very challenging. This is primarily due to the inherent under-calibration issues in multi-camera setup, including inconsistent imaging effects stemming from separately calibrated image signal processing units in diverse cameras, and system errors arising from mechanical vibrations during driving that affect rela- tive camera poses. In this paper, we present UC-NeRF, a novel method tailored for novel view synthesis in under-calibrated multi-view camera systems. Firstly, we propose a layer-based color correction to rectify the color inconsistency in different image regions. Second, we propose virtual warping to generate more viewpoint-diverse but color-consistent virtual views for color correction and 3D recovery. Finally, a spatiotemporally constrained pose refinement is designed for more robust and accurate pose calibration in multi-camera systems. Our method not only achieves state-of-the-art performance of novel view synthesis in multi- camera setups, but also effectively facilitates depth estimation in large-scale out- door scenes with the synthesized novel views.

🗓️ TODO

  • [✔] Pose Refinement codes
  • [✔] End-to-end UC-NeRF training
  • [✔] Depth prior for virtual warping
  • [✔] bash scripts for training, testing and rendering

🚀 Setup

# Clone the repo.
git clone https://github.com/kcheng1021/UC-NeRF.git
cd nerf

# Make a conda environment.
conda create --name ucnerf python=3.9
conda activate ucnerf

# Install requirements.
pip install -r requirements.txt

# Install other cuda extensions
pip install ./gridencoder

# Install nvdiffrast 
git clone https://github.com/NVlabs/nvdiffrast
pip install ./nvdiffrast

# Install a specific cuda version of torch_scatter 
# see more detail at https://github.com/rusty1s/pytorch_scatter
CUDA=cu113
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html

🚀 Dataset demo

Here we present a sample Waymo scene in Waymo-100613.

The detail tutorial of the preprocessing of Waymo dataset can be refered in StreetSurf.

🚀 Start up

# getting the refined poses
cd pose_refinement
# following the instruction in the submodule

# getting the depth for virtual warping
cd mvs
# following the instruction in the submodule

cd nerf

# including the bash scripts of train, eval nerf model, and render video
bash scripts/train_waymo.sh

🚀 Pipeline

image

🎫 License

For non-commercial use, this code is released under the LICENSE. For commercial use, please contact Xuejin Chen.

🖊️ Citation

If you find this project useful in your research, please consider cite:

@inproceedings{cheng2023uc,
  title={UC-NERF: Neural Radiance Field for under-calibrated multi-view cameras},
  author={Cheng, Kai and Long, Xiaoxiao and Yin, Wei and Wang, Jin and Wu, Zhiqiang and Ma, Yuexin and Wang, Kaixuan and Chen, Xiaozhi and Chen, Xuejin},
  booktitle={The Twelfth International Conference on Learning Representations},
  year={2023}
}

Acknowledgements

Thanks to Zip-NeRF-Pytorch for amazing zipnerf pytorch implementation. Thanks to COLMAP and CER-MVS for providing the foundation for our work.

uc-nerf's People

Contributors

cklibra avatar kcheng1021 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

uc-nerf's Issues

test demo

Thank for your excellent work , I want to get the result with your pretrained model and your test code , so when they can be public

Question about Formula 7 in the paper

Thank you to the author for releasing such an excellent article.
I have some questions about Announcement 7 in the article
image
Pixels do not have a definite depth, so the projection seems incorrect.
Can I understand it as using the depth estimated by MVS here

Code for nuscenes

Hi! Thanks for the great work!!
Would you provide the code to run a demo/train on the nuscenes dataset?
Thank you!

pose_refinement error & failed to estimate pose in other dataset

Hi, I am very interested in your great work.

  1. I want to try the pose refinement in waymo data (you provided scene), but I met an error:

F0202 06:06:36.188254 3254 problem_impl.cc:482] Parameter block not found: 0x5645a00b9e60. You must add the parameter block to the problem before it can be set constant.
*** Check failure stack trace: ***
@ 0x7f9ba4388b03 google::LogMessage::Fail()
@ 0x7f9ba43909d1 google::LogMessage::SendToLog()
@ 0x7f9ba43887c2 google::LogMessage::Flush()
@ 0x7f9ba438a78f google::LogMessageFatal::~LogMessageFatal()
@ 0x7f9ba3ffb72f ceres::internal::ProblemImpl::SetParameterBlockConstant()
@ 0x56459d8594f1 colmap::BundleAdjuster::ParameterizeCameras()
@ 0x56459d8622b5 colmap::RigBundleAdjuster::SetUp()
@ 0x56459d8627a2 colmap::RigBundleAdjuster::Solve()
@ 0x56459d6994df colmap::RunRigBundleAdjuster()
@ 0x56459d6449b3 main
@ 0x7f9ba20eed90 (unknown)
@ 0x7f9ba20eee40 __libc_start_main
@ 0x56459d64e455 _start
./pose_refinement/stpr/scripts/mvs/run_multi_cam_pose_opt.sh: line 9: 3254 Aborted (core dumped) ${COLMAP_EXE} rig_bundle_adjuster --input_path $POSE_PATH/sparse/0 --output_path $POSE_PATH/sparse/0 --rig_config_path "$POSE_PATH/cam_rigid_config.json" --estimate_rig_relative_poses 0 --RigBundleAdjustment.refine_relative_poses 1 --BundleAdjustment.max_num_iterations 50 --BundleAdjustment.refine_focal_length 0 --BundleAdjustment.refine_principal_point 0 --BundleAdjustment.refine_extra_params 0

What causes it? However, I can still get the sparse point and camera pose in the images.bin file, and is the pose in the images.bin refined?

  1. I can't get the sparse point and camera pose in the images.bin file for my data, and also reported the above error. The result is bad as below:

image

Could you provide me with some help?

Thanks in advance!

Model released

Thanks to your great work!

I am very concerned about whether you will released the nerf model trained on waymo or nuscene etc.?

best wishes~

非常棒的工作!

我非常关心您是否会公开在waymo或是nuscene等室外驾驶数据集上的重建nerf的模型?我非常想试试

祝好~

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc when training

Nice Work! I met this bug when using the train_waymo.sh.

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

I have followed the instruction to train and also installed gridencoder.
My torch version is 1.12.0+cu113.
I wonder if it is revelant to the cuda extension in the setup (pip install ./extensions/cuda) that isn't provided yet. Do you have any ideas solving this bug? Thanks a lot!

Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
  warnings.warn(
/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=VGG16_Weights.IMAGENET1K_V1`. You can also use `weights=VGG16_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
Loading model from: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/lpips/weights/v0.1/vgg.pth
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: -11) local_rank: 0 (pid: 2961871) of binary: /DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/bin/python
Traceback (most recent call last):
  File "/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/accelerate/commands/accelerate_cli.py", line 47, in main
    args.func(args)
  File "/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/accelerate/commands/launch.py", line 1008, in launch_command
    multi_gpu_launcher(args)
  File "/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/accelerate/commands/launch.py", line 666, in multi_gpu_launcher
    distrib_run.run(args)
  File "/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/torch/distributed/run.py", line 752, in run
    elastic_launch(
  File "/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 131, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/DATA_EDS2/yebj/yebj2304/miniconda3/envs/ucnerf/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 245, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
=========================================================
train.py FAILED
---------------------------------------------------------
Failures:
[1]:
  time      : 2023-12-20_16:01:25
  host      : lthpc-2.local
  rank      : 1 (local_rank: 1)
  exitcode  : -11 (pid: 2961872)
  error_file: <N/A>
  traceback : Signal 11 (SIGSEGV) received by PID 2961872

out of memery on v100

I train waymo_100613 with reslution 1920 1280 on gpu v100, turns out OUT OF MEMORY,

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.