code: def forward(self, model_outputs, ground_truth):
      rgb_gt = ground_truth["rgb"].cuda()
      network_object_mask = model_outputs["network_object_mask"]
      object_mask = model_outputs["object_mask"]
  
      rgb_loss = self.get_rgb_loss(
          model_outputs["rgb_values"],
          rgb_gt,
          network_object_mask,
          object_mask,
      )
      mask_loss = self.get_mask_loss(
          model_outputs["sdf_output"], network_object_mask, object_mask
      )
      eikonal_loss = self.get_eikonal_loss(model_outputs["grad_theta"])
      reg_loss = self.get_reg_loss(
          model_outputs["points_mesh_ray_gt"],
          model_outputs["points_pre"],
      )
      normal_loss = 1 - torch.mean(
          self.cosine(
              model_outputs["points_mesh_ray_normals"],
              model_outputs["surface_normals"],
          )
      )
      loss = (
          rgb_loss
          + self.eikonal_weight * eikonal_loss
          + self.mask_weight * mask_loss
          + self.reg_weight * reg_loss
          + self.normal_weight * normal_loss
      )
  
      return {
          "loss": loss,
          "rgb_loss": rgb_loss,
          "eikonal_loss": eikonal_loss,
          "mask_loss": mask_loss,
          "reg_loss": reg_loss,
          "normal_loss": normal_loss,
      }
  
file_path: insightface/reconstruction/PBIDR/code/model/loss.py
imports: import torch
  from torch import nn
  from torch.nn import functional
label_desc: Use image node_id 6 for calling the IFLoss obj's underlying member method code with example usage: obj.forward(model_outputs, ground_truth) and returns: dict