docstr: Tests a basic case that includes foreground and backgrounds
docstr_tok: ["Tests","a","basic","case","that","includes","foreground","and","backgrounds"]
code: def testBaseCase(self):
      """
      Tests a basic case that includes foreground and backgrounds
      """
      all_anchors = np.array(
          [
              [200, 100, 400, 400],  # foreground
              [300, 300, 400, 400],  # background
              [200, 380, 300, 500],  # background
          ],
          dtype=np.float32,
      )
      labels, bbox_targets, max_overlaps = self._run_rpn_target(
          all_anchors, self.gt_boxes, self.config
      )
  
      # Check we get exactly a foreground, an ignored background (because of
      # minibatch_size = 2) and a background. Also checks they are in the
      # correct order
      self.assertAllEqual(labels, np.array([1, 0, -1]))
  
      # Assert bbox targets we are ignoring are zero.
      self.assertAllEqual(
          bbox_targets[1:], [[0, 0, 0, 0], [0, 0, 0, 0]]
      )
  
      # Assert bbox target is not zero
      self.assertTrue((bbox_targets[0] != 0).any())
  
      # Check max_overlaps shape
      self.assertEqual(max_overlaps.shape, (3,))
  
      # Check that the foreground has overlap > 0.7.
      # Only the first value is checked because it's the only anchor assigned
      # to foreground.
      self.assertGreaterEqual(max_overlaps[0], 0.7)
  
      # Check that the backgrounds have overlaps < 0.3.
      self.assertEqual(np.less_equal(max_overlaps[1:], 0.3).all(), True)
  
file_path: luminoth/luminoth/models/fasterrcnn/rpn_target_test.py
imports: import numpy
  import tensorflow
  from easydict import EasyDict
  from luminoth.models.fasterrcnn.rpn_target import RPNTarget
label_desc: Use image node_id 3 for calling the RPNTargetTest obj's underlying member method code with example usage: obj.testBaseCase() without return types