docstr: Tests a basic case.
  
  We have one ground truth box and three proposals. One should be
  background, one foreground, and one should be an ignored background
  (i.e. less IoU than whatever value is set as
  config.background_threshold_low).
docstr_tok: ["Tests","a","basic","case",".","We","have","one","ground","truth","box","and","three","proposals",".","One","should","be","background",",","one","foreground",",","and","one","should","be","an","ignored","background","(","i.e",".","less","IoU","than","whatever","value","is","set","as","config.background_threshold_low",")","."]
code: def testBasic(self):
      """Tests a basic case.
  
      We have one ground truth box and three proposals. One should be
      background, one foreground, and one should be an ignored background
      (i.e. less IoU than whatever value is set as
      config.background_threshold_low).
      """
  
      gt_boxes = tf.constant(
          [(20, 20, 80, 100, self._placeholder_label)], dtype=tf.float32
      )
  
      proposed_boxes = tf.constant(
          [
              (55, 75, 85, 105),  # Background
              # IoU ~0.1293
              (25, 21, 85, 105),  # Foreground
              # IoU ~0.7934
              (78, 98, 99, 135),  # Ignored
              # IoU ~0.0015
          ],
          dtype=tf.float32,
      )
  
      proposals_label, bbox_targets = self._run_rcnn_target(
          self._shared_model, gt_boxes, proposed_boxes
      )
      # We test that all values are 'close' (up to self._equality_delta)
      # instead of equal to avoid failing due to a floating point rounding
      # error.
      # We sum 1 to the placeholder label because rcnn_target does the same
      # due to the fact that it uses 0 to signal 'background'.
      self.assertAllClose(
          proposals_label,
          np.array([0.0, self._placeholder_label + 1, -1.0]),
          atol=self._equality_delta,
      )
  
      self.assertEqual(
          proposals_label[proposals_label >= 0].shape[0],
          self._config.minibatch_size,
      )
  
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 3 for calling the RCNNTargetTest obj's underlying member method code with example usage: obj.testBasic() without return types