|
@@ -154,20 +154,19 @@ def training_report(tb_writer, iteration, Ll1, loss, l1_loss, elapsed, testing_i
|
|
|
|
|
|
|
|
for config in validation_configs:
|
|
for config in validation_configs:
|
|
|
if config['cameras'] and len(config['cameras']) > 0:
|
|
if config['cameras'] and len(config['cameras']) > 0:
|
|
|
- images = torch.tensor([], device="cuda")
|
|
|
|
|
- gts = torch.tensor([], device="cuda")
|
|
|
|
|
|
|
+ l1_test = 0
|
|
|
|
|
+ psnr_test = 0
|
|
|
for idx, viewpoint in enumerate(config['cameras']):
|
|
for idx, viewpoint in enumerate(config['cameras']):
|
|
|
image = torch.clamp(renderFunc(viewpoint, scene.gaussians, *renderArgs)["render"], 0.0, 1.0)
|
|
image = torch.clamp(renderFunc(viewpoint, scene.gaussians, *renderArgs)["render"], 0.0, 1.0)
|
|
|
gt_image = torch.clamp(viewpoint.original_image.to("cuda"), 0.0, 1.0)
|
|
gt_image = torch.clamp(viewpoint.original_image.to("cuda"), 0.0, 1.0)
|
|
|
- images = torch.cat((images, image.unsqueeze(0)), dim=0)
|
|
|
|
|
- gts = torch.cat((gts, gt_image.unsqueeze(0)), dim=0)
|
|
|
|
|
if tb_writer and (idx < 5):
|
|
if tb_writer and (idx < 5):
|
|
|
tb_writer.add_images(config['name'] + "_view_{}/render".format(viewpoint.image_name), image[None], global_step=iteration)
|
|
tb_writer.add_images(config['name'] + "_view_{}/render".format(viewpoint.image_name), image[None], global_step=iteration)
|
|
|
if iteration == testing_iterations[0]:
|
|
if iteration == testing_iterations[0]:
|
|
|
tb_writer.add_images(config['name'] + "_view_{}/ground_truth".format(viewpoint.image_name), gt_image[None], global_step=iteration)
|
|
tb_writer.add_images(config['name'] + "_view_{}/ground_truth".format(viewpoint.image_name), gt_image[None], global_step=iteration)
|
|
|
-
|
|
|
|
|
- l1_test = l1_loss(images, gts)
|
|
|
|
|
- psnr_test = psnr(images, gts).mean()
|
|
|
|
|
|
|
+ l1_test += l1_loss(image, gt_image).mean()
|
|
|
|
|
+ psnr_test += psnr(image, gt_image).mean()
|
|
|
|
|
+ psnr_test /= len(config['cameras'])
|
|
|
|
|
+ l1_test /= len(config['cameras'])
|
|
|
print("\n[ITER {}] Evaluating {}: L1 {} PSNR {}".format(iteration, config['name'], l1_test, psnr_test))
|
|
print("\n[ITER {}] Evaluating {}: L1 {} PSNR {}".format(iteration, config['name'], l1_test, psnr_test))
|
|
|
if tb_writer:
|
|
if tb_writer:
|
|
|
tb_writer.add_scalar(config['name'] + '/loss_viewpoint - l1_loss', l1_test, iteration)
|
|
tb_writer.add_scalar(config['name'] + '/loss_viewpoint - l1_loss', l1_test, iteration)
|