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
@@ -35,7 +35,7 @@ from nerfactory.renderers.renderers import (
RGBRenderer,
UncertaintyRenderer,
)
from nerfactory.utils import colors, visualization, writer
from nerfactory.utils import colors, misc, visualization, writer
class NerfWGraph(Graph):
@@ -180,7 +180,7 @@ class NerfWGraph(Graph):
}
return outputs
def get_loss_dict(self, outputs, batch):
def get_loss_dict(self, outputs, batch, metrics_dict, loss_coefficients):
device = outputs["rgb_coarse"].device
image = batch["image"].to(device)
rgb_coarse = outputs["rgb_coarse"]
@@ -198,6 +198,7 @@ class NerfWGraph(Graph):
"uncertainty_loss": uncertainty_loss,
"density_loss": density_loss,
}
loss_dict = misc.scale_dict(loss_dict, loss_coefficients)
return loss_dict
def log_test_image_outputs(self, image_idx, step, batch, outputs):