code: def raw2outputs(raw, z_vals, rays_d, raw_noise_std=0, white_bkg=True):
      """Transforms model's predictions to semantically meaningful values.
      Args:
          raw: [num_rays, num_samples along ray, 4]. Prediction from model.
          z_vals: [num_rays, num_samples along ray]. Integration time.
          rays_d: [num_rays, 3]. Direction of each ray.
      Returns:
          rgb_map: [num_rays, 3]. Estimated RGB color of a ray.
          disp_map: [num_rays]. Disparity map. Inverse of depth map.
          acc_map: [num_rays]. Sum of weights along each ray.
          weights: [num_rays, num_samples]. Weights assigned to each sampled color.
          depth_map: [num_rays]. Estimated distance to object.
      """
      device = raw.device
      _raw2alpha = lambda raw, dists, act_fn=F.relu: 1.0 - torch.exp(
          -act_fn(raw) * dists
      )
  
      dists = z_vals[..., 1:] - z_vals[..., :-1]
      dists = torch.cat(
          [
              dists,
              torch.Tensor(
                  [1e10],
              )
              .expand(dists[..., :1].shape)
              .to(device),
          ],
          -1,
      )  # [N_rays, N_samples]
  
      dists = dists * torch.norm(rays_d[..., None, :], dim=-1)
  
      rgb = torch.sigmoid(raw[..., :3])  # [N_rays, N_samples, 3]
      noise = 0.0
      if raw_noise_std > 0.0:
          noise = (
              torch.randn(raw[..., 3].shape, device=device)
              * raw_noise_std
          )
      alpha = _raw2alpha(
          raw[..., 3] + noise, dists
      )  # [N_rays, N_samples]
      weights = (
          alpha
          * torch.cumprod(
              torch.cat(
                  [
                      torch.ones((alpha.shape[0], 1), device=device),
                      1.0 - alpha + 1e-10,
                  ],
                  -1,
              ),
              -1,
          )[:, :-1]
      )
      rgb_map = torch.sum(weights[..., None] * rgb, -2)  # [N_rays, 3]
  
      depth_map = torch.sum(weights * z_vals, -1)
      disp_map = 1.0 / torch.max(
          1e-10 * torch.ones_like(depth_map, device=device),
          depth_map / torch.sum(weights, -1),
      )
      acc_map = torch.sum(weights, -1)
  
      if white_bkg:
          rgb_map = rgb_map + (1.0 - acc_map[..., None])
  
      return rgb_map, disp_map, acc_map, weights, depth_map
  
file_path: ml-neuman/utils/render_utils.py
imports: import random
  import numpy
  import torch
  import torch.nn.functional
  from pytorch3d.structures import Meshes
  from pytorch3d.renderer import RasterizationSettings, MeshRenderer, MeshRasterizer, HardPhongShader, PointLights, TexturesVertex, PerspectiveCameras
  from PIL import Image
  from cameras.camera_pose import CameraPose
  from utils import ray_utils
  from utils.constant import DEFAULT_GEO_THRESH
  from geometry import transformations
label_desc: Use image node_id 3 for calling a global function with example usage: raw2outputs(raw, z_vals, rays_d, raw_noise_std, white_bkg) and returns: rgb_map,  disp_map,  acc_map,  weights,  depth_map