Updating metrics dict code and logic for all the graphs (#198)

* illustrating logic of metrics dict with vanilla nerf

* updated all graph impls

* clean up.

* cleanup.

* format.

Co-authored-by: Alexander Kristoffersen <akristoffersen@berkeley.edu>
This commit is contained in:
Ethan WeberandAlexander Kristoffersen authored and GitHub committed 2022-07-26 21:02:45 -07:00
1 parent 0777883fb6
commit 934bd4bd72
8 files changed
+43 -23

No files matched your search

+3 -2
View File
@@ -37,7 +37,7 @@ from nerfactory.renderers.renderers import (
DepthRenderer,
RGBRenderer,
)
from nerfactory.utils import colors, visualization, writer
from nerfactory.utils import colors, misc, visualization, writer
class MipNerfGraph(Graph):
@@ -134,11 +134,12 @@ class MipNerfGraph(Graph):
}
return outputs
def get_loss_dict(self, outputs, batch):
def get_loss_dict(self, outputs, batch, metrics_dict, loss_coefficients):
image = batch["image"]
rgb_loss_coarse = self.rgb_loss(image, outputs["rgb_coarse"])
rgb_loss_fine = self.rgb_loss(image, outputs["rgb_fine"])
loss_dict = {"rgb_loss_coarse": rgb_loss_coarse, "rgb_loss_fine": rgb_loss_fine}
loss_dict = misc.scale_dict(loss_dict, loss_coefficients)
return loss_dict
def log_test_image_outputs(self, image_idx, step, batch, outputs):