class_docstr: IoU Balanced Sampling.
  
  arXiv: https://arxiv.org/pdf/1904.02701.pdf (CVPR 2019)
  
  Sampling proposals according to their IoU. `floor_fraction` of needed RoIs
  are sampled from proposals whose IoU are lower than `floor_thr` randomly.
  The others are sampled from proposals whose IoU are higher than
  `floor_thr`. These proposals are sampled from some bins evenly, which are
  split by `num_bins` via IoU evenly.
  
  Args:
      num (int): number of proposals.
      pos_fraction (float): fraction of positive proposals.
      floor_thr (float): threshold (minimum) IoU for IoU balanced sampling,
          set to -1 if all using IoU balanced sampling.
      floor_fraction (float): sampling fraction of proposals under floor_thr.
      num_bins (int): number of bins in IoU balanced sampling.
code: def __init__(
      self,
      num,
      pos_fraction,
      floor_thr=-1,
      floor_fraction=0,
      num_bins=3,
      **kwargs,
  ):
      super(IoUBalancedNegSampler, self).__init__(
          num, pos_fraction, **kwargs
      )
      assert floor_thr >= 0 or floor_thr == -1
      assert 0 <= floor_fraction <= 1
      assert num_bins >= 1
  
      self.floor_thr = floor_thr
      self.floor_fraction = floor_fraction
      self.num_bins = num_bins
  
file_path: insightface/detection/scrfd/mmdet/core/bbox/samplers/iou_balanced_neg_sampler.py
imports: import numpy
  import torch
  from ..builder import BBOX_SAMPLERS
  from .random_sampler import RandomSampler
label_desc: Use image node_id 1 to create a new IoUBalancedNegSampler object from inherited base classes: RandomSampler with example: obj = IoUBalancedNegSampler(num, pos_fraction, floor_thr, floor_fraction, num_bins)