code: def compute_targets(
      proposals, gt_rois, iou_threshold, normalize_means, normalize_stds
  ):
      """Compute bounding-box regression targets for an image."""
      if len(gt_rois) == 0:
          # Bail if the image has no ground-truth ROIs
          return np.zeros((proposals.shape[0], 6), dtype=np.float32)
  
      # Get IoU overlap between each ex ROI and gt ROI
      ex_gt_overlaps = bbox_overlaps(
          np.ascontiguousarray(proposals, dtype=np.float),
          np.ascontiguousarray(gt_rois, dtype=np.float),
      )
      # Indices of examples for which we try to make predictions
      ex_inds = np.where(ex_gt_overlaps >= iou_threshold)[
          0
      ]  # cfg.TRAIN.BBOX_THRESH
  
      # Find which gt ROI each ex ROI has max overlap with:
      # this will be the ex ROI's gt target
      gt_assignment_inds = ex_gt_overlaps.argmax(axis=1)
      gt_assignment_rois = gt_rois[gt_assignment_inds, :]
  
      regression_targets = bbox_transform(
          proposals[ex_inds], gt_assignment_rois[ex_inds]
      )
  
      # Optionally normalize targets by a precomputed mean and stdev
      if normalize_means is not None:
          regression_targets = (
              regression_targets - normalize_means
          ) / normalize_stds
  
      targets = np.zeros((proposals.shape[0], 6), dtype=np.float32)
      targets[ex_inds, :4] = regression_targets
      targets[ex_inds, 4] = gt_rois[gt_assignment_inds[ex_inds], 4]
      targets[ex_inds, 5] = 1  # bbiw
      return targets
  
imports: import os, sys
  import numpy
  import cv2
  from utils.rpn.bbox_transform import bbox_transform
  from utils.cython_modules.cython_bbox import bbox_overlaps
label_desc: Use image node_id 8 for calling a global function with example usage: compute_targets(proposals, gt_rois, iou_threshold, normalize_means, normalize_stds) and returns: targets, np