class_docstr: Random sampler.
  
  Args:
      num (int): Number of samples
      pos_fraction (float): Fraction of positive samples
      neg_pos_up (int, optional): Upper bound number of negative and
          positive samples. Defaults to -1.
      add_gt_as_proposals (bool, optional): Whether to add ground truth
          boxes as proposals. Defaults to True.
code: def __init__(
      self,
      num,
      pos_fraction,
      neg_pos_ub=-1,
      add_gt_as_proposals=True,
      **kwargs,
  ):
      from mmdet.core.bbox import demodata
  
      super(RandomSampler, self).__init__(
          num, pos_fraction, neg_pos_ub, add_gt_as_proposals
      )
      self.rng = demodata.ensure_rng(kwargs.get("rng", None))
  
file_path: insightface/detection/scrfd/mmdet/core/bbox/samplers/random_sampler.py
imports: import torch
  from ..builder import BBOX_SAMPLERS
  from .base_sampler import BaseSampler
label_desc: Use image node_id 1 to create a new RandomSampler object from inherited base classes: BaseSampler with example: obj = RandomSampler(num, pos_fraction, neg_pos_ub, add_gt_as_proposals)