class_docstr: Proposal layer takes as input:
  (1) output of RPN cls_score
  (2) output of RPN bbox regression
  
  Converts that to an output ROIs
  (5, num_ROIs) <- [image_idx, x_min, y_min, x_max, y_max]
  
  Steps:
  1. For each anchor, generate anchor boxes and apply bbox deltas to get
     bbox proposals
  2. Clip bboxes to image
  3. remove bbox with H < threshold or W < threshold
  4. set the scores to be -1 for the padded area
  5. Take top pre_nms_N scores
  6. apply NMS with a threshold
  7. return the top num_ROIs proposals
  8. provide ROIs
  9. compute bbox targets and store in target_buffers
class_docstr_tok: ["Proposal","layer","takes","as","input",":","(","1",")","output","of","RPN","cls_score","(","2",")","output","of","RPN","bbox","regression","Converts","that","to","an","output","ROIs","(","5",",","num_ROIs",")","<","-","[","image_idx",",","x_min",",","y_min",",","x_max",",","y_max","]","Steps",":","1",".","For","each","anchor",",","generate","anchor","boxes","and","apply","bbox","deltas","to","get","bbox","proposals","2",".","Clip","bboxes","to","image","3.","remove","bbox","with","H","<","threshold","or","W","<","threshold","4.","set","the","scores","to","be","-1","for","the","padded","area","5",".","Take","top","pre_nms_N","scores","6.","apply","NMS","with","a","threshold","7.","return","the","top","num_ROIs","proposals","8.","provide","ROIs","9.","compute","bbox","targets","and","store","in","target_buffers"]
docstr: Bounding-box regression targets (bbox_target_data) are stored in a
  compact form N x (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_targets (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","(","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_targets","(","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, labels):
      """Bounding-box regression targets (bbox_target_data) are stored in a
      compact form N x (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_targets (ndarray): N x 4K blob of regression targets
          bbox_inside_weights (ndarray): N x 4K blob of loss weights
      """
      bbox_targets = np.zeros(
          (self.num_rois, 4 * self.num_classes), dtype=np.float32
      )
      bbox_inside_weights = np.zeros(
          bbox_targets.shape, dtype=np.float32
      )
      inds = np.where(labels > 0)[0]
      for ind in inds:
          l = labels[ind]
          start = int(4 * l)
          end = int(start + 4)
          bbox_targets[ind, start:end] = bbox_target_data[ind]
          bbox_inside_weights[ind, start:end] = 1.0
      return bbox_targets, bbox_inside_weights
  
imports: from __future__ import division
  import numpy
  from neon.layers.layer import Layer
  from generate_anchors import generate_all_anchors
  from util import compute_targets, calculate_bb_overlap
label_desc: Use image node_id 13 for calling the ProposalLayer obj's underlying member method code with example usage: obj._get_bbox_regression_labels(bbox_target_data, labels) and returns: bbox_targets,  bbox_inside_weights