From 2d1366e1ca6ded26ad3e982d999d703252969134 Mon Sep 17 00:00:00 2001 From: AdamRashid96 Date: Tue, 20 Jun 2023 00:00:18 +0000 Subject: [PATCH] fixed bug using median depth by accident --- nerfstudio/models/depth_nerfacto.py | 2 +- nerfstudio/models/nerfacto.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/nerfstudio/models/depth_nerfacto.py b/nerfstudio/models/depth_nerfacto.py index 6bfcc3ba2..f3f791e80 100644 --- a/nerfstudio/models/depth_nerfacto.py +++ b/nerfstudio/models/depth_nerfacto.py @@ -105,7 +105,7 @@ class DepthNerfactoModel(NerfactoModel): loss_dict["depth_loss"] = self.config.depth_loss_mult * metrics_dict["depth_loss"] else: loss_dict["depth_ranking"] = np.interp(self.step, [0, 2000], [0, 0.2]) * depth_ranking_loss( - outputs["depth"], batch["depth_image"] + outputs["expected_depth"], batch["depth_image"] ) # Else use depth ranking loss diff --git a/nerfstudio/models/nerfacto.py b/nerfstudio/models/nerfacto.py index a4cfb342b..6fcc984c7 100644 --- a/nerfstudio/models/nerfacto.py +++ b/nerfstudio/models/nerfacto.py @@ -45,7 +45,6 @@ from nerfstudio.model_components.losses import ( orientation_loss, pred_normal_loss, scale_gradients_by_distance_squared, - depth_ranking_loss, ) from nerfstudio.model_components.ray_samplers import ( ProposalNetworkSampler, @@ -359,10 +358,6 @@ class NerfactoModel(Model): loss_dict["pred_normal_loss"] = self.config.pred_normal_loss_mult * torch.mean( outputs["rendered_pred_normal_loss"] ) - if "depth_image" in batch: - loss_dict["depth_ranking"] = np.interp(self.step, [0, 2000], [0, 0.2]) * depth_ranking_loss( - outputs["depth"], batch["depth_image"] - ) return loss_dict def get_image_metrics_and_images(