code: def _compute_targets(ex_rois, gt_rois, labels):
      """Compute bounding-box regression targets for an image."""
  
      assert ex_rois.shape[0] == gt_rois.shape[0]
      assert ex_rois.shape[1] == 4
      assert gt_rois.shape[1] == 4
  
      targets = bbox_transform(ex_rois, gt_rois)
      if BBOX_NORMALIZE_TARGETS_PRECOMPUTED:
          # Optionally normalize targets by a precomputed mean and stdev
          targets = (
              targets - np.array(BBOX_NORMALIZE_MEANS)
          ) / np.array(BBOX_NORMALIZE_STDS)
      return np.hstack((labels[:, np.newaxis], targets)).astype(
          np.float32, copy=False
      )
  
file_path: neon/examples/faster-rcnn/tests/proposal_target_layer_ref.py
imports: from __future__ import division
  from __future__ import print_function
  from builtins import object
  import numpy
  import numpy.random
  from util import bbox_transform, calculate_bb_overlap
label_desc: Use image node_id 2 for calling a global function with example usage: _compute_targets(ex_rois, gt_rois, labels) and returns: np