mirror of
https://github.com/graphdeco-inria/gaussian-splatting
synced 2024-11-22 08:18:17 +00:00
Nice fixed output
This commit is contained in:
parent
43e42bd20f
commit
45a9877ac4
@ -1 +1 @@
|
|||||||
Subproject commit f9b5d03bc86c8fabd8d7a26fabff91129618b4ce
|
Subproject commit 71ced0023fd0c0aaaa83bb1ab32bce1d4ed630c7
|
11
metrics.py
11
metrics.py
@ -30,7 +30,8 @@ def evaluate(model_paths):
|
|||||||
per_view_dict_polytopeonly = {}
|
per_view_dict_polytopeonly = {}
|
||||||
|
|
||||||
for scene_dir in model_paths:
|
for scene_dir in model_paths:
|
||||||
print("Scene:", scene_dir)
|
try:
|
||||||
|
print("\nScene:", scene_dir)
|
||||||
full_dict[scene_dir] = {}
|
full_dict[scene_dir] = {}
|
||||||
per_view_dict[scene_dir] = {}
|
per_view_dict[scene_dir] = {}
|
||||||
full_dict_polytopeonly[scene_dir] = {}
|
full_dict_polytopeonly[scene_dir] = {}
|
||||||
@ -60,9 +61,9 @@ def evaluate(model_paths):
|
|||||||
psnrs.append(psnr(renders[idx], gts[idx]))
|
psnrs.append(psnr(renders[idx], gts[idx]))
|
||||||
lpipss.append(lpips(renders[idx], gts[idx], net_type='vgg'))
|
lpipss.append(lpips(renders[idx], gts[idx], net_type='vgg'))
|
||||||
|
|
||||||
print("SSIM: {}".format(torch.tensor(ssims).mean()))
|
print(" SSIM : {:>12.7f}".format(torch.tensor(ssims).mean(), ".5"))
|
||||||
print("PSNR: {}".format(torch.tensor(psnrs).mean()))
|
print(" PSNR : {:>12.7f}".format(torch.tensor(psnrs).mean(), ".5"))
|
||||||
print("LPIPS: {}".format(torch.tensor(lpipss).mean()))
|
print(" LPIPS: {:>12.7f}".format(torch.tensor(lpipss).mean(), ".5"), "\n")
|
||||||
|
|
||||||
full_dict[scene_dir][method].update({"SSIM": torch.tensor(ssims).mean().item(),
|
full_dict[scene_dir][method].update({"SSIM": torch.tensor(ssims).mean().item(),
|
||||||
"PSNR": torch.tensor(psnrs).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)
|
json.dump(full_dict[scene_dir], fp, indent=True)
|
||||||
with open(scene_dir + "/per_view.json", 'w') as fp:
|
with open(scene_dir + "/per_view.json", 'w') as fp:
|
||||||
json.dump(per_view_dict[scene_dir], fp, indent=True)
|
json.dump(per_view_dict[scene_dir], fp, indent=True)
|
||||||
|
except:
|
||||||
|
print("Unable to compute metrics for model", scene_dir)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
device = torch.device("cuda:0")
|
device = torch.device("cuda:0")
|
||||||
|
Loading…
Reference in New Issue
Block a user