class_docstr: Bbox sampling result.
      
class_docstr_tok: ["Bbox","sampling","result","."]
code: def __init__(
      self,
      pos_inds,
      neg_inds,
      bboxes,
      gt_bboxes,
      assign_result,
      gt_flags,
  ):
      self.pos_inds = pos_inds
      self.neg_inds = neg_inds
      if pos_inds.size > 0:
          self.pos_bboxes = bboxes[pos_inds]
          self.neg_bboxes = bboxes[neg_inds]
          self.pos_is_gt = gt_flags[pos_inds]
  
          self.num_gts = gt_bboxes.shape[0]
          self.pos_assigned_gt_inds = (
              assign_result.gt_inds[pos_inds] - 1
          )
  
          if gt_bboxes.numel() == 0:
              # hack for index error case
              assert self.pos_assigned_gt_inds.numel() == 0
              self.pos_gt_bboxes = paddle.zeros(
                  gt_bboxes.shape, dtype=gt_bboxes.dtype
              ).reshape((-1, 4))
          else:
              if len(gt_bboxes.shape) < 2:
                  gt_bboxes = gt_bboxes.reshape((-1, 4))
  
              self.pos_gt_bboxes = paddle.index_select(
                  gt_bboxes,
                  self.pos_assigned_gt_inds.astype("int64"),
                  axis=0,
              )
  
          if assign_result.labels is not None:
              self.pos_gt_labels = assign_result.labels[pos_inds]
          else:
              self.pos_gt_labels = None
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from ppdet.core.workspace import register
label_desc: Use image node_id 1 to create a new SamplingResult object  with example: obj = SamplingResult(pos_inds, neg_inds, bboxes, gt_bboxes, assign_result, gt_flags)