docstr: Tests that despite a foreground doesn't exist, an anchor is always
  assigned.
  Also tests the positive clobbering behaviour setting.
docstr_tok: ["Tests","that","despite","a","foreground","does","n't","exist",",","an","anchor","is","always","assigned",".","Also","tests","the","positive","clobbering","behaviour","setting","."]
code: def testWithNoClearMatch(self):
      """
      Tests that despite a foreground doesn't exist, an anchor is always
      assigned.
      Also tests the positive clobbering behaviour setting.
      """
      all_anchors = np.array(
          [
              [300, 300, 400, 400],  # background
              [200, 380, 300, 500],  # background
          ]
      )
  
      labels, bbox_targets, max_overlaps = self._run_rpn_target(
          all_anchors, self.gt_boxes, self.config
      )
  
      # Check we get only one foreground anchor.
      self.assertAllEqual(labels, np.array([1, 0]))
      self.assertTrue((bbox_targets[0] != 0).all())
      self.assertAllEqual(bbox_targets[1], np.zeros(4))
  
      config = self.config
      config["clobber_positives"] = True
  
      labels, bbox_targets, max_overlaps = self._run_rpn_target(
          all_anchors, self.gt_boxes, config
      )
  
      # Check we don't get a foreground anchor because of possitive
      # clobbering enabled.
      self.assertAllEqual(labels, np.array([0, 0]))
      self.assertAllEqual(bbox_targets, np.zeros((2, 4)))
  
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 5 for calling the RPNTargetTest obj's underlying member method code with example usage: obj.testWithNoClearMatch() without return types