class_docstr: 2D Overlaps (e.g. IoUs, GIoUs) Calculator.
docstr: Calculate IoU between 2D bboxes.
  
  Args:
      bboxes1 (Tensor): bboxes have shape (m, 4) in <x1, y1, x2, y2>
          format, or shape (m, 5) in <x1, y1, x2, y2, score> format.
      bboxes2 (Tensor): bboxes have shape (m, 4) in <x1, y1, x2, y2>
          format, shape (m, 5) in <x1, y1, x2, y2, score> format, or be
          empty. If ``is_aligned `` is ``True``, then m and n must be
          equal.
      mode (str): "iou" (intersection over union), "iof" (intersection
          over foreground), or "giou" (generalized intersection over
          union).
      is_aligned (bool, optional): If True, then m and n must be equal.
          Default False.
  
  Returns:
      Tensor: shape (m, n) if ``is_aligned `` is False else shape (m,)
docstr_tok: ["Calculate","IoU","between","2D","bboxes",".","Args",":","bboxes1","(","Tensor",")",":","bboxes","have","shape","(","m",",","4",")","in","<","x1",",","y1",",","x2",",","y2",">","format",",","or","shape","(","m",",","5",")","in","<","x1",",","y1",",","x2",",","y2",",","score",">","format",".","bboxes2","(","Tensor",")",":","bboxes","have","shape","(","m",",","4",")","in","<","x1",",","y1",",","x2",",","y2",">","format",",","shape","(","m",",","5",")","in","<","x1",",","y1",",","x2",",","y2",",","score",">","format",",","or","be","empty",".","If","``","is_aligned","``","is","``","True","``",",","then","m","and","n","must","be","equal",".","mode","(","str",")",":","``","iou","''","(","intersection","over","union",")",",","``","iof","''","(","intersection","over","foreground",")",",","or","``","giou","''","(","generalized","intersection","over","union",")",".","is_aligned","(","bool",",","optional",")",":","If","True",",","then","m","and","n","must","be","equal",".","Default","False",".","Returns",":","Tensor",":","shape","(","m",",","n",")","if","``","is_aligned","``","is","False","else","shape","(","m",",",")"]
code: def __call__(self, bboxes1, bboxes2, mode="iou", is_aligned=False):
      """Calculate IoU between 2D bboxes.
  
      Args:
          bboxes1 (Tensor): bboxes have shape (m, 4) in <x1, y1, x2, y2>
              format, or shape (m, 5) in <x1, y1, x2, y2, score> format.
          bboxes2 (Tensor): bboxes have shape (m, 4) in <x1, y1, x2, y2>
              format, shape (m, 5) in <x1, y1, x2, y2, score> format, or be
              empty. If ``is_aligned `` is ``True``, then m and n must be
              equal.
          mode (str): "iou" (intersection over union), "iof" (intersection
              over foreground), or "giou" (generalized intersection over
              union).
          is_aligned (bool, optional): If True, then m and n must be equal.
              Default False.
  
      Returns:
          Tensor: shape (m, n) if ``is_aligned `` is False else shape (m,)
      """
      assert bboxes1.size(-1) in [0, 4, 5]
      assert bboxes2.size(-1) in [0, 4, 5]
      if bboxes2.size(-1) == 5:
          bboxes2 = bboxes2[..., :4]
      if bboxes1.size(-1) == 5:
          bboxes1 = bboxes1[..., :4]
      return bbox_overlaps(bboxes1, bboxes2, mode, is_aligned)
  
imports: import torch
  from .builder import IOU_CALCULATORS
label_desc: Use image node_id 1 for calling the BboxOverlaps2D obj's underlying member method code with example usage: obj.__call__(bboxes1, bboxes2, mode, is_aligned) and returns: bbox_overlaps