mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-30 21:09:58 +08:00
Cleaning Model() function signatures (#433)
Removing different model.forward() functions, eliminating overloading, making it easier to understand
This commit is contained in:
1 parent
acd126c1ef
commit
96d4974d73
10 files changed
+26
-38
No files matched your search
@@ -178,7 +178,7 @@ class TensoRFModel(Model):
|
||||
outputs = {"rgb": rgb, "accumulation": accumulation, "depth": depth}
|
||||
return outputs
|
||||
|
||||
def get_loss_dict(self, outputs, batch, metrics_dict, loss_coefficients) -> Dict[str, torch.Tensor]:
|
||||
def get_loss_dict(self, outputs, batch, metrics_dict=None) -> Dict[str, torch.Tensor]:
|
||||
# Scaling metrics by coefficients to create the losses.
|
||||
device = outputs["rgb"].device
|
||||
image = batch["image"].to(device)
|
||||
@@ -192,7 +192,7 @@ class TensoRFModel(Model):
|
||||
line_feature_loss = self.feature_loss(line_coef, torch.zeros_like(line_coef))
|
||||
|
||||
loss_dict = {"rgb_loss": rgb_loss, "feature_loss": plane_feature_loss + line_feature_loss}
|
||||
loss_dict = misc.scale_dict(loss_dict, loss_coefficients)
|
||||
loss_dict = misc.scale_dict(loss_dict, self.config.loss_coefficients)
|
||||
return loss_dict
|
||||
|
||||
def get_image_metrics_and_images(
|
||||
|
||||
Reference in new issue
Block a user