code: def compute_depth_map(weights, z_vals, depth_threshold=0.5):
      """Compute the depth using the median accumulation.
  
      Note that this differs from the depth computation in NeRF-W's codebase!
  
      Args:
        weights: the density weights from NeRF.
        z_vals: the z coordinates of the samples.
        depth_threshold: the accumulation threshold which will be used as the depth
          termination point.
  
      Returns:
        A tensor containing the depth of each input pixel.
      """
      opaqueness_mask = compute_opaqueness_mask(
          weights, depth_threshold
      )
      return jnp.sum(opaqueness_mask * z_vals, axis=-1)
  
file_path: nerfies/nerfies/model_utils.py
imports: from flax import linen
  from flax import optim
  from flax import struct
  from jax import lax
  from jax import random
  import jax.numpy
label_desc: Use image node_id 7 for calling a global function with example usage: compute_depth_map(weights, z_vals, depth_threshold) and returns: jnp