Problem Description
In NestedDepthAnything3Net._apply_depth_alignment(), when converting predicted depth to metric scale, the code scales depth and extrinsics but misses scaling the gaussians. This causes the exported Gaussian point clouds (via gs_ply) to have a different scale than the camera poses (via cameras.json), resulting in incorrect rendering when using standard 3DGS viewers.
Root Cause
In src/depth_anything_3/model/da3.py, lines 410-414:
# Apply scaling to depth and extrinsics
output.depth *= scale_factor
output.extrinsics[:, :, :3, 3] *= scale_factor
output.is_metric = 1
output.scale_factor = scale_factor.item()
The output.gaussians (which contains means and scales) is not scaled, even though it was computed using the pre-scaling depth values.
Impact
When exporting to 3DGS format (--export-format gs_ply):
- Before fix: Gaussian points have ~40x larger extent than camera positions
- Result: Rendering from predicted camera poses shows completely wrong views (PSNR ~7 dB)
- Verification: 3DGS viewers cannot correctly display the scene from the exported cameras
Proposed Fix
Add scaling for gaussians in _apply_depth_alignment():
# Apply scaling to depth and extrinsics
output.depth *= scale_factor
output.extrinsics[:, :, :3, 3] *= scale_factor
output.is_metric = 1
output.scale_factor = scale_factor.item()
# FIX: Also scale gaussians if they exist to maintain consistency
if hasattr(output, 'gaussians') and output.gaussians is not None:
output.gaussians.means *= scale_factor
output.gaussians.scales *= scale_factor
Files Affected
src/depth_anything_3/model/da3.py: _apply_depth_alignment() method (around line 416)
Additional Context
This issue only affects users who:
- Use the nested/metric model (DA3NESTED variants)
- Export to 3DGS format (
gs_ply)
- Attempt to render from the exported camera poses
The scene.glb export is not affected because it uses COLMAP point clouds which are computed from the scaled depth maps.
Problem Description
In
NestedDepthAnything3Net._apply_depth_alignment(), when converting predicted depth to metric scale, the code scalesdepthandextrinsicsbut misses scaling thegaussians. This causes the exported Gaussian point clouds (viags_ply) to have a different scale than the camera poses (viacameras.json), resulting in incorrect rendering when using standard 3DGS viewers.Root Cause
In
src/depth_anything_3/model/da3.py, lines 410-414:The
output.gaussians(which containsmeansandscales) is not scaled, even though it was computed using the pre-scaling depth values.Impact
When exporting to 3DGS format (
--export-format gs_ply):Proposed Fix
Add scaling for gaussians in
_apply_depth_alignment():Files Affected
src/depth_anything_3/model/da3.py:_apply_depth_alignment()method (around line 416)Additional Context
This issue only affects users who:
gs_ply)The
scene.glbexport is not affected because it uses COLMAP point clouds which are computed from the scaled depth maps.