metrics automation

This commit is contained in:
dotag1 committed 2025-04-30 19:38:09 -04:00
1 parent 1b1e2d9fba
commit 8daba3cfc7
14 files changed
+442 -139

No files matched your search

+14 -1
View File
@@ -80,4 +80,17 @@ if __name__ == "__main__":
print("SSIM: ", ssim_index)
print("PSNR: ", psnr_index)
lpips_index = piq.LPIPS(reduction='none')(torch.stack(gts), torch.stack(preds))
print("LPIPS: ", torch.mean(lpips_index))
print("LPIPS: ", torch.mean(lpips_index))
results = {
"SSIM": str(ssim_index),
"PSNR": str(psnr_index),
"LPIPS": str(torch.mean(lpips_index))
}
output_path = os.path.join(args.data_dir, "ldr_results.json")
with open(output_path, 'w') as f:
json.dump(results, f, indent=4)
print(f"Saved metrics to: {output_path}")