docstr: Tests we're prioritizing being the best proposal for a gt_box in
  label selection.
docstr_tok: ["Tests","we","'re","prioritizing","being","the","best","proposal","for","a","gt_box","in","label","selection","."]
code: def testLabelPriority(self):
      """Tests we're prioritizing being the best proposal for a gt_box in
      label selection.
      """
  
      first_label = self._placeholder_label
      second_label = self._placeholder_label + 1
  
      num_classes = second_label + 10
  
      # We need a custom config to have a larger minibatch_size.
      config = EasyDict(
          {
              "foreground_threshold": 0.5,
              "background_threshold_high": 0.5,
              # Use zero to get all non matching as backgrounds.
              "background_threshold_low": 0.0,
              "foreground_fraction": 0.5,
              # We change the minibatch_size the catch all our foregrounds
              "minibatch_size": 64,
          }
      )
      model = RCNNTarget(num_classes, config, seed=0)
  
      gt_boxes = tf.constant(
          [
              [10, 10, 20, 20, first_label],
              [10, 10, 30, 30, second_label],
          ],
          dtype=tf.float32,
      )
  
      # Both proposals have the first gt_box as the best match, but one of
      # them should be assigned to the label of the second gt_box anyway.
      proposed_boxes = tf.constant(
          [
              [10, 10, 20, 20],
              [12, 10, 20, 20],
          ],
          dtype=tf.float32,
      )
  
      (proposals_label, _) = self._run_rcnn_target(
          model, gt_boxes, proposed_boxes
      )
  
      num_first_label = len(
          proposals_label[proposals_label == first_label + 1]
      )
      num_second_label = len(
          proposals_label[proposals_label == second_label + 1]
      )
  
      # Assertions
      self.assertEqual(num_first_label, 1)
      self.assertEqual(num_second_label, 1)
  
file_path: luminoth/luminoth/models/fasterrcnn/rcnn_target_test.py
imports: import numpy
  import tensorflow
  from easydict import EasyDict
  from luminoth.models.fasterrcnn.rcnn_target import RCNNTarget
  from luminoth.utils.test.gt_boxes import generate_gt_boxes
label_desc: Use image node_id 12 for calling the RCNNTargetTest obj's underlying member method code with example usage: obj.testLabelPriority() without return types