4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00

Fix depth-supervised nerf when using z-buffer depth. (#1340)

* fix z buffer depth

* remove script
This commit is contained in:
Jeffrey Hu 2023-02-02 18:22:55 -08:00 committed by GitHub
parent 2e79c93cd2
commit a0976d1ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -291,7 +291,7 @@ def depth_loss(
Depth loss scalar.
"""
if not is_euclidean:
termination_depth = termination_depth / directions_norm
termination_depth = termination_depth * directions_norm
steps = (ray_samples.frustums.starts + ray_samples.frustums.ends) / 2
if depth_loss_type == DephtLossType.DS_NERF:

View File

@ -108,7 +108,7 @@ class DepthNerfactoModel(NerfactoModel):
metrics, images = super().get_image_metrics_and_images(outputs, batch)
ground_truth_depth = batch["depth_image"]
if not self.config.is_euclidean_depth:
ground_truth_depth = ground_truth_depth / outputs["directions_norm"]
ground_truth_depth = ground_truth_depth * outputs["directions_norm"]
ground_truth_depth_colormap = colormaps.apply_depth_colormap(ground_truth_depth)
predicted_depth_colormap = colormaps.apply_depth_colormap(