kwea123 / nerf_pl

NeRF (Neural Radiance Fields) and NeRF in the Wild using pytorch-lightning
https://www.youtube.com/playlist?list=PLDV2CyUo4q-K02pNEyDr7DYpTQuka3mbV
MIT License
2.66k stars 470 forks source link

Does Nerf-W evaluate PSNR as well? #216

Open CultureAddiction opened 7 months ago

CultureAddiction commented 7 months ago

I tried some of phototourism example(https://github.com/kwea123/nerf_pl/releases/tag/nerfw_branden), but none of phototourism examples did not evaluate mean psnr value. None of mine does nor none of examples in the link does.

On your code(eval.py), it seems variable 'psnrs' does not have any element, as "print(f'Mean PSNR : {mean_psnr:.2f}')" (line 224) does not shows up. I guess it occurs because dictionary 'sample' does not have 'rgb' keyword (line 212, "if 'rgbs' in sample:"), which means dataset[i] does not have 'rgb' keyword as well (line 190, "sample = dataset[i]"). But on my root directory, I do have rgb images.

Why is this happening? Is the PSNR value could only be executed on the lego examples?

+) Reading datasets/phototourism.py, It seems datasets[i] does not contain rgbs keyword because of split 'test' goes to the else clause, which do not assign rgbs keyword (while split=val, test_train assign rgbs at line 221). Is this some miswritten code refering to the 'test_train' instead? Or does else clause at phototourism.py intends for the eval.py?

Given Command (File exist, eval.py): (nerf_pl_w) gpuadmin@sg3:~/YBS/nerf_pl$ dir /home/gpuadmin/YBS/nerf_pl/data_Y/sacre_coeur/dense/images 00204549_3820006713.jpg 23327088_8208333914.jpg 44614566_9095733872.jpg 64837411_8951541213.jpg 81476348_2961239173.jpg 00318781_8039756060.jpg 23363225_3187214147.jpg 44656171_6113568114.jpg 64910553_235013699.jpg 81504086_158954845.jpg 00508355_4347298255.jpg 23405080_2639976634.jpg 44746189_3541589301.jpg 64934559_13243105465.jpg 81670953_3302107502.jpg 00867546_4119336568.jpg 23411478_1545601833.jpg 44748036_142906563.jpg 64951325_3689575044.jpg 81703421_7754459314.jpg

...

(nerf_pl_w) gpuadmin@sg3:~/YBS/nerf_pl$ python eval.py \

--root_dir /home/gpuadmin/YBS/nerf_pl/data_Y/trevi_fountain \ --dataset_name phototourism --scene_name trevi_scale8_nerfw\ --split test --N_samples 256 --N_importance 256 \ --N_vocab 3200 --encode_a --encode_t \ --ckpt_path /home/gpuadmin/YBS/nerf_pl/ckpts/trevi_scale8_nerfw/epoch=19.ckpt\ --chunk 16384 --img_wh 640 480 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 120/120 [1:31:49<00:00, 45.91s/it]