docstr: Tests that we're using bbox_pred correctly.
docstr_tok: ["Tests","that","we","'re","using","bbox_pred","correctly","."]
code: def testBboxPred(self):
      """Tests that we're using bbox_pred correctly."""
  
      proposed_boxes = tf.constant(
          [
              (200, 315, 400, 370),
              (56, 0, 106, 4),
              (15, 15, 20, 20),
          ]
      )
  
      gt_boxes_per_class = tf.constant(
          [
              [(0, 0, 1, 1)],
              [(5, 5, 10, 10)],
              [(15, 15, 20, 20)],
          ]
      )
      bbox_pred = self._get_bbox_pred(
          proposed_boxes, gt_boxes_per_class
      )
  
      cls_prob = tf.constant(
          [
              (0.0, 1.0, 0.0, 0.0),
              (0.2, 0.25, 0.3, 0.25),
              (0.45, 0.0, 0.0, 0.55),
          ]
      )
  
      proposal_prediction = self._run_rcnn_proposal(
          self._shared_model,
          proposed_boxes,
          bbox_pred,
          cls_prob,
      )
  
      objects = self._compute_tf_graph(
          tf.squeeze(gt_boxes_per_class, axis=1)
      )
      # We need to sort the objects by `cls_prob` from high to low score.
      cls_prob = self._compute_tf_graph(cls_prob)
      # Ignoring background prob get the reverse argsort for the max of each
      # object.
      decreasing_idxs = cls_prob[:, 1:].max(axis=1).argsort()[::-1]
      # Sort by indexing.
      objects_sorted = objects[decreasing_idxs]
  
      self.assertAllClose(
          proposal_prediction["objects"],
          objects_sorted,
          atol=self._equality_delta,
      )
  
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 9 for calling the RCNNProposalTest obj's underlying member method code with example usage: obj.testBboxPred() without return types