docstr: Computes valid bbox_pred from proposals and gt_boxes for each class.
  
  Args:
      proposed_boxes: Tensor with shape (num_proposals, 4).
      gt_boxes_per_class: Tensor holding the ground truth boxes for each
          class. Has shape (num_classes, num_gt_boxes_per_class, 4).
  
  Returns:
      A tensor with shape (num_proposals, num_classes * 4), holding the
      correct bbox_preds.
docstr_tok: ["Computes","valid","bbox_pred","from","proposals","and","gt_boxes","for","each","class",".","Args",":","proposed_boxes",":","Tensor","with","shape","(","num_proposals",",","4",")",".","gt_boxes_per_class",":","Tensor","holding","the","ground","truth","boxes","for","each","class",".","Has","shape","(","num_classes",",","num_gt_boxes_per_class",",","4",")",".","Returns",":","A","tensor","with","shape","(","num_proposals",",","num_classes","*","4",")",",","holding","the","correct","bbox_preds","."]
code: def _get_bbox_pred(self, proposed_boxes, gt_boxes_per_class):
      """Computes valid bbox_pred from proposals and gt_boxes for each class.
  
      Args:
          proposed_boxes: Tensor with shape (num_proposals, 4).
          gt_boxes_per_class: Tensor holding the ground truth boxes for each
              class. Has shape (num_classes, num_gt_boxes_per_class, 4).
  
      Returns:
          A tensor with shape (num_proposals, num_classes * 4), holding the
          correct bbox_preds.
      """
  
      def bbox_encode(gt_boxes):
          return encode(proposed_boxes, gt_boxes)
  
      bbox_pred_tensor = tf.map_fn(
          bbox_encode, gt_boxes_per_class, dtype=tf.float32
      )
      # We need to explicitly unstack the tensor so that tf.concat works
      # properly.
      bbox_pred_list = tf.unstack(bbox_pred_tensor)
      return tf.concat(bbox_pred_list, 1)
  
file_path: luminoth/luminoth/models/fasterrcnn/rcnn_proposal_test.py
imports: import tensorflow
  from easydict import EasyDict
  from luminoth.models.fasterrcnn.rcnn_proposal import RCNNProposal
  from luminoth.utils.bbox_transform_tf import encode
label_desc: Use image node_id 4 for calling the RCNNProposalTest obj's underlying member method code with example usage: obj._get_bbox_pred(proposed_boxes, gt_boxes_per_class) and returns: tf, encode