changwoonchoi / IBL-NeRF

Official implementation of IBL-NeRF: Image-Based Lighting Formulation of Neural Radiance Fields (Computer Graphics Forum, Pacific Graphics 2023)
https://changwoon.info/publications/IBL-NeRF
MIT License
40 stars 4 forks source link

gt_values["roughness"][...,0] #7

Closed yunchao-ding closed 1 year ago

yunchao-ding commented 1 year ago

Hi, Dear author, the parameters in the raw2outputs function in ibl_nerf_renderer.py define gt_values, gt_values should represent a matrix sequence or a map, but no corresponding parameters were found. For the 'gt_values["roughness"][...,0]' quoted later, where is the corresponding parameter representation for gt_values? And what does the following [...,0] represent? Hope to get your help. Thank you so much!

changwoonchoi commented 1 year ago

Hi, When you want to use gt values during rendering, you can pass the gt values as a parameter of render_decomp. https://github.com/changwoonchoi/IBL-NeRF/blob/3be45827f250425ea223a78baf847d136bcf9dad/src/train.py#L416

In train.py, the gt_value is obtained from the sample_generator: https://github.com/changwoonchoi/IBL-NeRF/blob/3be45827f250425ea223a78baf847d136bcf9dad/src/train.py#L350

And the sample_generator https://github.com/changwoonchoi/IBL-NeRF/blob/3be45827f250425ea223a78baf847d136bcf9dad/src/utils/generator_utils.py#L56 gives values obtained from dataset at random pixel samples. https://github.com/changwoonchoi/IBL-NeRF/blob/3be45827f250425ea223a78baf847d136bcf9dad/src/utils/generator_utils.py#L113

You can decide which information to retrieve by configs. (e.g. self.load_albedo, self.load_roughness, ...) Please check get_info method in NerfDataset class. https://github.com/changwoonchoi/IBL-NeRF/blob/3be45827f250425ea223a78baf847d136bcf9dad/src/dataset/dataset_interface.py#L123

Also, [..., 0] is for matching tensor dimensions to calculate. e.g., https://github.com/changwoonchoi/IBL-NeRF/blob/3be45827f250425ea223a78baf847d136bcf9dad/src/nerf_models/ibl_nerf_renderer.py#L363

yunchao-ding commented 1 year ago

Thank you for your help! I have understood how to use it.