code: def iou_loss(pred, target, eps=1e-6):
      """IoU loss.
  
      Computing the IoU loss between a set of predicted bboxes and target bboxes.
      The loss is calculated as negative log of IoU.
  
      Args:
          pred (torch.Tensor): Predicted bboxes of format (x1, y1, x2, y2),
              shape (n, 4).
          target (torch.Tensor): Corresponding gt bboxes, shape (n, 4).
          eps (float): Eps to avoid log(0).
  
      Return:
          torch.Tensor: Loss tensor.
      """
      ious = bbox_overlaps(pred, target, is_aligned=True).clamp(min=eps)
      loss = -ious.log()
      return loss
  
imports: import math
  import torch
  import torch.nn
  from mmdet.core import bbox_overlaps
  from ..builder import LOSSES
  from .utils import weighted_loss
label_desc: Use image node_id 1 for calling a global function with example usage: iou_loss(pred, target, eps) and returns: loss