Nice fixed output

This commit is contained in:
bkerbl 2023-07-05 11:56:17 +02:00
parent 43e42bd20f
commit 45a9877ac4
2 changed files with 40 additions and 37 deletions

@ -1 +1 @@
Subproject commit f9b5d03bc86c8fabd8d7a26fabff91129618b4ce
Subproject commit 71ced0023fd0c0aaaa83bb1ab32bce1d4ed630c7

View File

@ -30,7 +30,8 @@ def evaluate(model_paths):
per_view_dict_polytopeonly = {}
for scene_dir in model_paths:
print("Scene:", scene_dir)
try:
print("\nScene:", scene_dir)
full_dict[scene_dir] = {}
per_view_dict[scene_dir] = {}
full_dict_polytopeonly[scene_dir] = {}
@ -60,9 +61,9 @@ def evaluate(model_paths):
psnrs.append(psnr(renders[idx], gts[idx]))
lpipss.append(lpips(renders[idx], gts[idx], net_type='vgg'))
print("SSIM: {}".format(torch.tensor(ssims).mean()))
print("PSNR: {}".format(torch.tensor(psnrs).mean()))
print("LPIPS: {}".format(torch.tensor(lpipss).mean()))
print(" SSIM : {:>12.7f}".format(torch.tensor(ssims).mean(), ".5"))
print(" PSNR : {:>12.7f}".format(torch.tensor(psnrs).mean(), ".5"))
print(" LPIPS: {:>12.7f}".format(torch.tensor(lpipss).mean(), ".5"), "\n")
full_dict[scene_dir][method].update({"SSIM": torch.tensor(ssims).mean().item(),
"PSNR": torch.tensor(psnrs).mean().item(),
@ -75,6 +76,8 @@ def evaluate(model_paths):
json.dump(full_dict[scene_dir], fp, indent=True)
with open(scene_dir + "/per_view.json", 'w') as fp:
json.dump(per_view_dict[scene_dir], fp, indent=True)
except:
print("Unable to compute metrics for model", scene_dir)
if __name__ == "__main__":
device = torch.device("cuda:0")