class_docstr: Assign object detection proposals to ground-truth targets. Produces proposal
  classification labels and bounding-box regression targets.
class_docstr_tok: ["Assign","object","detection","proposals","to","ground-truth","targets",".","Produces","proposal","classification","labels","and","bounding-box","regression","targets","."]
docstr: Bounding-box regression targets (bbox_target_data) are stored in a
  compact form N x (class, tx, ty, tw, th)
  
  This function expands those targets into the 4-of-4*K representation used
  by the network (i.e. only one class has non-zero targets).
  
  Returns:
      bbox_target (ndarray): N x 4K blob of regression targets
      bbox_inside_weights (ndarray): N x 4K blob of loss weights
docstr_tok: ["Bounding-box","regression","targets","(","bbox_target_data",")","are","stored","in","a","compact","form","N","x","(","class",",","tx",",","ty",",","tw",",","th",")","This","function","expands","those","targets","into","the","4-of-4","*","K","representation","used","by","the","network","(","i.e",".","only","one","class","has","non-zero","targets",")",".","Returns",":","bbox_target","(","ndarray",")",":","N","x","4K","blob","of","regression","targets","bbox_inside_weights","(","ndarray",")",":","N","x","4K","blob","of","loss","weights"]
code: def _get_bbox_regression_labels(self, bbox_target_data, num_classes):
      """Bounding-box regression targets (bbox_target_data) are stored in a
      compact form N x (class, tx, ty, tw, th)
  
      This function expands those targets into the 4-of-4*K representation used
      by the network (i.e. only one class has non-zero targets).
  
      Returns:
          bbox_target (ndarray): N x 4K blob of regression targets
          bbox_inside_weights (ndarray): N x 4K blob of loss weights
      """
  
      clss = bbox_target_data[:, 0].astype(int)
      bbox_targets = np.zeros(
          (clss.size, 4 * num_classes), dtype=np.float32
      )
      bbox_inside_weights = np.zeros(
          bbox_targets.shape, dtype=np.float32
      )
      inds = np.where(clss > 0)[0]
      for ind in inds:
          cls = clss[ind]
          start = 4 * cls
          end = start + 4
          bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
          bbox_inside_weights[ind, start:end] = [1.0, 1.0, 1.0, 1.0]
      return bbox_targets, bbox_inside_weights
  
file_path: CNTK/Examples/Image/Detection/utils/rpn/proposal_target_layer.py
imports: from cntk import output_variable, FreeDimension
  from cntk.ops.functions import UserFunction
  import yaml
  import numpy
  import numpy.random
  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 the ProposalTargetLayer obj's underlying member method code with example usage: obj._get_bbox_regression_labels(bbox_target_data, num_classes) and returns: bbox_targets,  bbox_inside_weights