docstr: Tests a basic case that includes two gt_boxes. What is going to happen
  is that for each gt_box its fixed at least a foreground. After if there
  are too many foreground, some of them will be disabled.
docstr_tok: ["Tests","a","basic","case","that","includes","two","gt_boxes",".","What","is","going","to","happen","is","that","for","each","gt_box","its","fixed","at","least","a","foreground",".","After","if","there","are","too","many","foreground",",","some","of","them","will","be","disabled","."]
code: def testWithMultipleGTBoxes(self):
      """
      Tests a basic case that includes two gt_boxes. What is going to happen
      is that for each gt_box its fixed at least a foreground. After if there
      are too many foreground, some of them will be disabled.
      """
      all_anchors = np.array(
          [
              [300, 300, 400, 390],  # background IoU < 0.3
              [300, 300, 400, 400],  # foreground for the first gt_box
              [100, 310, 120, 380],  # foreground for the second gt_box
          ],
          dtype=np.float32,
      )
      config = self.config
      config["minibatch_size"] = 3
  
      gt_boxes = np.array([[200, 0, 400, 400], [100, 300, 120, 375]])
      labels, bbox_targets, max_overlaps = self._run_rpn_target(
          all_anchors, gt_boxes, config
      )
  
      # Check we get exactly a foreground, in this case the first one,
      # a background and an ignored foreground.
      # Also checks they are in the correct order.
      self.assertAllEqual(labels, np.array([0, 1, -1]))
  
      # Assert bbox targets we are ignoring are zero.
      self.assertAllEqual(bbox_targets[0], [0, 0, 0, 0])
  
      self.assertAllEqual(bbox_targets[2], [0, 0, 0, 0])
  
      # Assert bbox target is not zero
      self.assertTrue((bbox_targets[1] != 0).any())
  
      # Check max_overlaps shape
      self.assertEqual(max_overlaps.shape, (3,))
  
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 6 for calling the RPNTargetTest obj's underlying member method code with example usage: obj.testWithMultipleGTBoxes() without return types