code: def eiou_loss(
      pred: Tensor,
      target: Tensor,
      smooth_point: float = 0.1,
      eps: float = 1e-7,
  ) -> Tensor:
      r"""Implementation of paper `Extended-IoU Loss: A Systematic
      IoU-Related Method: Beyond Simplified Regression for Better
      Localization <https://ieeexplore.ieee.org/abstract/document/9429909>`_
  
      Code is modified from https://github.com//ShiqiYu/libfacedetection.train.
  
      Args:
          pred (Tensor): Predicted bboxes of format (x1, y1, x2, y2),
              shape (n, 4).
          target (Tensor): Corresponding gt bboxes, shape (n, 4).
          smooth_point (float): hyperparameter, default is 0.1.
          eps (float): Epsilon to avoid log(0).
  
      Return:
          Tensor: Loss tensor.
      """
      px1, py1, px2, py2 = (
          pred[:, 0],
          pred[:, 1],
          pred[:, 2],
          pred[:, 3],
      )
      tx1, ty1, tx2, ty2 = (
          target[:, 0],
          target[:, 1],
          target[:, 2],
          target[:, 3],
      )
  
      # extent top left
      ex1 = torch.min(px1, tx1)
      ey1 = torch.min(py1, ty1)
  
      # intersection coordinates
      ix1 = torch.max(px1, tx1)
      iy1 = torch.max(py1, ty1)
      ix2 = torch.min(px2, tx2)
      iy2 = torch.min(py2, ty2)
  
      # extra
      xmin = torch.min(ix1, ix2)
      ymin = torch.min(iy1, iy2)
      xmax = torch.max(ix1, ix2)
      ymax = torch.max(iy1, iy2)
  
      # Intersection
      intersection = (
          (ix2 - ex1) * (iy2 - ey1)
          + (xmin - ex1) * (ymin - ey1)
          - (ix1 - ex1) * (ymax - ey1)
          - (xmax - ex1) * (iy1 - ey1)
      )
      # Union
      union = (
          (px2 - px1) * (py2 - py1)
          + (tx2 - tx1) * (ty2 - ty1)
          - intersection
          + eps
      )
      # IoU
      ious = 1 - (intersection / union)
  
      # Smooth-EIoU
      smooth_sign = (ious < smooth_point).detach().float()
      loss = 0.5 * smooth_sign * (ious**2) / smooth_point + (
          1 - smooth_sign
      ) * (ious - 0.5 * smooth_point)
      return loss
  
imports: import math
  import warnings
  from typing import Optional
  import torch
  import torch.nn
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import bbox_overlaps
  from .utils import weighted_loss
label_desc: Use image node_id 6 for calling a global function with example usage: eiou_loss(pred, target, smooth_point, eps) and returns: loss