class_docstr: Assign object detection proposals to ground-truth targets. Produces proposal
  classification labels and bounding-box regression targets.
code: def forward(self, bottom, top):
      # Proposal ROIs (0, x1, y1, x2, y2) coming from RPN
      # (i.e., rpn.proposal_layer.ProposalLayer), or any other source
      all_rois = bottom[0]  # .data
      # GT boxes (x1, y1, x2, y2, label)
      # TODO(rbg): it's annoying that sometimes I have extra info before
      # and other times after box coordinates -- normalize to one format
      gt_boxes = bottom[1]  # .data
  
      # Include ground-truth boxes in the set of candidate rois
      zeros = np.zeros((gt_boxes.shape[0], 1), dtype=gt_boxes.dtype)
      all_rois = np.vstack(
          (all_rois, np.hstack((zeros, gt_boxes[:, :-1])))
      )
  
      # Sanity check: single batch only
      assert np.all(
          all_rois[:, 0] == 0
      ), "Only single item batches are supported"
  
      # num_images = 1
      # rois_per_image = int(cfg.TRAIN.BATCH_SIZE / num_images)
      rois_per_image = cfg.TRAIN.BATCH_SIZE
      fg_rois_per_image = np.round(
          cfg.TRAIN.FG_FRACTION * rois_per_image
      ).astype(int)
  
      # Sample rois with classification labels and bounding box regression
      # targets
      labels, rois, bbox_targets, bbox_inside_weights = _sample_rois(
          all_rois,
          gt_boxes,
          fg_rois_per_image,
          rois_per_image,
          self._num_classes,
          deterministic=self._determininistic_mode,
      )
  
      if DEBUG:
          print("num fg: {}".format((labels > 0).sum()))
          print("num bg: {}".format((labels == 0).sum()))
          self._count += 1
          self._fg_num += (labels > 0).sum()
          self._bg_num += (labels == 0).sum()
          print("num fg avg: {}".format(self._fg_num / self._count))
          print("num bg avg: {}".format(self._bg_num / self._count))
          print(
              "ratio: {:.3f}".format(
                  float(self._fg_num) / float(self._bg_num)
              )
          )
  
      return rois, labels, bbox_targets, bbox_inside_weights
  
file_path: CNTK/Examples/Image/Detection/utils/caffe_layers/proposal_target_layer.py
imports: import yaml
  import numpy
  import numpy.random
  from utils.caffe_layers.default_config import cfg
  from utils.rpn.bbox_transform import bbox_transform
  from utils.cython_modules.cython_bbox import bbox_overlaps
label_desc: Use image node_id 4 for calling the ProposalTargetLayer obj's underlying member method code with example usage: obj.forward(bottom, top) and returns: rois,  labels,  bbox_targets,  bbox_inside_weights