class_docstr: Bucketing BBox Coder for Side-Aware Bounday Localization (SABL).
  
  Boundary Localization with Bucketing and Bucketing Guided Rescoring
  are implemented here.
  
  Please refer to https://arxiv.org/abs/1912.04260 for more details.
  
  Args:
      num_buckets (int): Number of buckets.
      scale_factor (int): Scale factor of proposals to generate buckets.
      offset_topk (int): Topk buckets are used to generate
           bucket fine regression targets. Defaults to 2.
      offset_upperbound (float): Offset upperbound to generate
           bucket fine regression targets.
           To avoid too large offset displacements. Defaults to 1.0.
      cls_ignore_neighbor (bool): Ignore second nearest bucket or Not.
           Defaults to True.
      clip_border (bool, optional): Whether clip the objects outside the
          border of the image. Defaults to True.
docstr: Get bucketing estimation and fine regression targets during
  training.
  
  Args:
      bboxes (torch.Tensor): source boxes, e.g., object proposals.
      gt_bboxes (torch.Tensor): target of the transformation, e.g.,
          ground truth boxes.
  
  Returns:
     encoded_bboxes(tuple[Tensor]): bucketing estimation
      and fine regression targets and weights
docstr_tok: ["Get","bucketing","estimation","and","fine","regression","targets","during","training",".","Args",":","bboxes","(","torch.Tensor",")",":","source","boxes",",","e.g.",",","object","proposals",".","gt_bboxes","(","torch.Tensor",")",":","target","of","the","transformation",",","e.g.",",","ground","truth","boxes",".","Returns",":","encoded_bboxes","(","tuple","[","Tensor","]",")",":","bucketing","estimation","and","fine","regression","targets","and","weights"]
code: def encode(self, bboxes, gt_bboxes):
      """Get bucketing estimation and fine regression targets during
      training.
  
      Args:
          bboxes (torch.Tensor): source boxes, e.g., object proposals.
          gt_bboxes (torch.Tensor): target of the transformation, e.g.,
              ground truth boxes.
  
      Returns:
         encoded_bboxes(tuple[Tensor]): bucketing estimation
          and fine regression targets and weights
      """
  
      assert bboxes.size(0) == gt_bboxes.size(0)
      assert bboxes.size(-1) == gt_bboxes.size(-1) == 4
      encoded_bboxes = bbox2bucket(
          bboxes,
          gt_bboxes,
          self.num_buckets,
          self.scale_factor,
          self.offset_topk,
          self.offset_upperbound,
          self.cls_ignore_neighbor,
      )
      return encoded_bboxes
  
file_path: insightface/detection/scrfd/mmdet/core/bbox/coder/bucketing_bbox_coder.py
imports: import numpy
  import torch
  import torch.nn.functional
  from ..builder import BBOX_CODERS
  from ..transforms import bbox_rescale
  from .base_bbox_coder import BaseBBoxCoder
label_desc: Use image node_id 2 for calling the BucketingBBoxCoder obj's underlying member method code with example usage: obj.encode(bboxes, gt_bboxes) and returns: encoded_bboxes