mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 22:38:48 +08:00
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:
1 parent
0777883fb6
commit
934bd4bd72
8 files changed
+43
-23
No files matched your search
@@ -32,7 +32,7 @@ from nerfactory.fields.modules.field_heads import FieldHeadNames
|
||||
from nerfactory.graphs.base import Graph
|
||||
from nerfactory.graphs.modules.ray_sampler import NGPSpacedSampler
|
||||
from nerfactory.optimizers.loss import MSELoss
|
||||
from nerfactory.utils import colors, visualization, writer
|
||||
from nerfactory.utils import colors, misc, visualization, writer
|
||||
from nerfactory.utils.callbacks import Callback
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class NGPGraph(Graph):
|
||||
}
|
||||
return outputs
|
||||
|
||||
def get_loss_dict(self, outputs, batch):
|
||||
def get_loss_dict(self, outputs, batch, metrics_dict, loss_coefficients):
|
||||
device = self.get_device()
|
||||
image = batch["image"].to(device)
|
||||
if "mask" in outputs:
|
||||
@@ -115,6 +115,7 @@ class NGPGraph(Graph):
|
||||
else:
|
||||
rgb_loss = self.rgb_loss(image, outputs["rgb"])
|
||||
loss_dict = {"rgb_loss": rgb_loss}
|
||||
loss_dict = misc.scale_dict(loss_dict, loss_coefficients)
|
||||
return loss_dict
|
||||
|
||||
def process_outputs_as_images(self, outputs): # pylint:disable=no-self-use
|
||||
|
||||
Reference in new issue
Block a user