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: Converts the roi labels from compressed (1, num_rois) shape
  to the one-hot format required for the global buffers of shape
  (num_classes, num_rois)
docstr_tok: ["Converts","the","roi","labels","from","compressed","(","1",",","num_rois",")","shape","to","the","one-hot","format","required","for","the","global","buffers","of","shape","(","num_classes",",","num_rois",")"]
code: def _onehot_labels(self, labels):
      """Converts the roi labels from compressed (1, num_rois) shape
      to the one-hot format required for the global buffers of shape
      (num_classes, num_rois)"""
      labels_full = np.zeros((self.num_classes, self.num_rois))
      for idx, l in enumerate(labels):
          labels_full[int(l), idx] = 1
      return labels_full
  
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 12 for calling the ProposalLayer obj's underlying member method code with example usage: obj._onehot_labels(labels) and returns: labels_full