Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-381

NeRF Depth Expectation

Problem

Compute the expected depth of a NeRF ray.

Using the same alpha and transmittance weights as volume rendering, with alpha_i = 1 - exp(-sigma_i * delta_i), return sum T_i * alpha_i * depth_i rounded to 4 decimal places.

Hint

Depth is the weighted average of sample positions with weights T_i * alpha_i.

Test cases

case 1
in: [[1,1],[1,1],[1,2]]
expected: 1.0972
case 2
in: [[1,1],[0,0],[1,2]]
expected: 0
case 3
in: [[100],[1],[5]]
expected: 5
case 4
in: [[0.5,0.5,0.5],[2,1,3],[1,2,3]]
expected: 1.4416
Starter codePython
def nerf_depth(deltas, sigmas, depths):
    # Your code here
    pass

4 test cases · run your code against them in the editor