airalcorn2 / pytorch-nerf

Minimal PyTorch implementations of NeRF and pixelNeRF.
MIT License
232 stars 25 forks source link

Original dataset from NeRF or my own dataset #2

Closed jdiazram closed 2 years ago

jdiazram commented 2 years ago

Hi, excellent work with this code of NeRF. I have a question, can I use the original dataset of NeRF or my own dataset using generate_nerf_dataset.py to create them?

thx

airalcorn2 commented 2 years ago

Thanks for the kind words. I have a notebook here demonstrating how to use my code to train a tiny NeRF model on the tiny_nerf_data.npz file used by the original NeRF authors in their notebook here. The only differences from my run_tiny_nerf.ipynb notebook are that:

1) I do not divide data["images"] by 255 because the images have already been normalized to be between zero and one. 2) I calculate camera_distance from the pose array, i.e., camera_distance = float(np.linalg.norm(data["poses"][0, :3, -1])). 3) I set t_n, t_f, and N_c to 2.0, 6.0, and 64, respectively, to follow the choices used in the original NeRF authors' notebook above.

For the following test view from the original NeRF authors' notebook:

download

my notebook generated the following after 14,900 iterations (~45 minutes on a P100 GPU):

download