Git Product home page Git Product logo

cr-nerf-pytorch's Introduction

CR-NeRF: Cross-Ray Neural Radiance Fields for Novel-view Synthesis from Unconstrained Image Collections

Yifan Yang · Shuhai Zhang · Zixiong Huang · Yubing Zhang . Mingkui Tan

ICCV 2023 Oral


Paper PDF

Table of Contents
  1. Introduction to CR-NeRF
  2. Video Demo
  3. Instructions
  4. Running Demo
  5. Training and testing
  6. Citation



Introduction-to-CR-NeRF

Pipeline
Pipeline of CR-NeRF
  • If you want to Train & Evaluate, please check dataset.md to prepare dataset, see Training and testing to train and benchmark CR-NeRF using Brandenburg Gate tainingset

  • During evaluation, given:

    • A RGB image of a desired image style
    • Camera position

with our CR-NeRF You will get:

  • image:
    • with the same camera position as the given one
    • with the same image style as the given image

For more details of our CR-NeRF, see architecture visualization in our encoder, transformation net, and decoder



Video-Demo

Appearance Hallucination


Trevi Fountain

Brandenburg Gate

Cross-Appearance Hallucination


From Trevi Fountain to Brandenburg Gate

From Brandenburg Gate to Trevi Fountain

Appearance Hallucination


Comparison with NeRF-W




Instructions




Running Demo

Download trained checkpoints from: google drive or Baidu drive password: z6wd

If you want video demo

#Set $scene_name and $save_dir1 and cuda devices in command/get_video_demo.sh
bash command/get_video_demo.sh

The rendered video (in .gif format) will be in path "{$save_dir1}/appearance_modification/{$scene_name}"

If you want images for evaluating metrics

bash command/get_rendered_images.sh

The rendered images will be in path "{$save_dir1}/{$exp_name1}"

Training and testing

#Set experiment name and cuda devices in train.sh 
bash command/train.sh
#Set the experiment name to match the training name, and set cuda devices in test.sh 
bash command/test.sh


Citation

@inproceedings{yang2023cross,
  title={Cross-Ray Neural Radiance Fields for Novel-view Synthesis from Unconstrained Image Collections},
  author={Yang, Yifan and Zhang, Shuhai and Huang, Zixiong and Zhang, Yubing and Tan, Mingkui},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={15901--15911},
  year={2023}
}

Acknowledgments

We thank Dong Liu's help in making the video demo

Here are some great resources we benefit from:


License

By downloading and using the code and model you agree to the terms in the LICENSE.

cr-nerf-pytorch's People

Contributors

rover-xingyu avatar yifyang993 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cr-nerf-pytorch's Issues

Some confuse about the decoder

Thank you for your great work and open source code. However, I am confused about the code:

  1. local variable 'net' referenced before assignment in
    hid0=self.feat_upsample_list[idx](net)
  2. the parameter "decoder_num_res_blocks" is not being used in:
    def __init__(self, args, residual_blocks=2):
  3. in the article, it is mentioned to set "m" to be smaller than "hcr1hcr2". However, in the code, it appears that the decoder receives image features that are of the same size as the image:
    self.decoder=NeuralRenderer(img_size=(args.img_wh[0],args.img_wh[1]) , featmap_size=(args.img_wh[0],args.img_wh[1]), feat_nc=args.nerf_out_dim, out_dim=3, args_here=args )
  4. moreover, may I ask if I am correct in understanding that when using a decoder, the loss can only be calculated for the entire image, since the decoder generates the complete image every time, and cannot sample rays like traditional NERF to calculate the loss on discrete rays?

reproduce psnr

Hi, I tried to retrain the model according to the following command, and the test psnr was only 25.33. In addition, I used the CR-NeRF-branden.ckpt model in the cloud disk for testing, and the accuracy was only 24.55. Can you please help me figure out where the problem is with the settings?
image

Training
python train_mask_grid_sample.py \
	--root_dir ../brandenburg_gate/ \
	--dataset_name phototourism \
	--save_dir ./tmp \
	--img_downscale 2 \
	--N_importance 64 --N_samples 64 \
	--num_epochs 1 --batch_size 1024 \
	--optimizer adam --lr 5e-4 --lr_scheduler cosine \
	--N_emb_xyz 15 --N_vocab 1500 \
	--maskrs_max 5e-2 --maskrs_min 6e-3 \
	--maskrs_k 1e-3 --maskrd 0 --N_a 48 \
	--weightKL 1e-5 --weightRecA 1e-3 \
	--weightMS 1e-6 --chunk 1310720 \
	--encode_a --encode_c  --encode_random \
	--model_mode 1-1 --decoder linearStyle \
	--decoder_num_res_blocks 1 \
	--nerf_out_dim 64 \
	--use_cache --proj_name style_gnerf \
	--use_mask --exp_name train/exp1 \
	--num_gpus 4

Testing
python eval.py \
  --root_dir ../brandenburg_gate/ \
  --save_dir ./tmp \
  --dataset_name phototourism \
  --scene_name train/exp1 \
  --split test_test \
  --img_downscale 2 \
  --N_samples 256 \
  --N_importance 256 \
  --N_emb_xyz 15 \
  --N_vocab 1500 \
  --ckpt_path ./tmp/ckpts/train/exp1/epoch20.ckpt \
  --chunk 20480 --img_wh 320 240 \
  --encode_a --decoder linearStyle \
  --decoder_num_res_blocks 1 \
  --nerf_out_dim 64

Blender dataset

Can u tell me how to train on blender dataset? i really dont get it. Big thanks for help!!

multiple 2D images to build a 2D image

Realization of multiple 2D images to build a 2D image, fusing the elements of multiple images into a single image, can the project be done?
实现多张二维图片构建一张二维图片,将多张图片的要素融合到一张图片上,该项目能办到吗?

How to choose m rays and some questions about eq(5)

Hi YifYang,
Thanks for your great work, I've just read your paper and don't read your code yet, I don't understand some questions:

  1. How to choose m rays during training, choose m pixels in a single image randomly, or m neighbors of a pixel? or some else rule? A set of m rays' features match m pixels' colors in loss function or a single pixel's color?
  2. In eq(5),why there need the second term (the beta term). And why it can be modeld as the D_theta5 network.
    Thanks a lot.

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.