docstr: Tests we're getting the right results when there's an odd minibatch
  size.
docstr_tok: ["Tests","we","'re","getting","the","right","results","when","there","'s","an","odd","minibatch","size","."]
code: def testOddMinibatchSize(self):
      """Tests we're getting the right results when there's an odd minibatch
      size.
      """
  
      config = EasyDict(
          {
              "foreground_threshold": 0.5,
              "background_threshold_high": 0.5,
              "background_threshold_low": 0.1,
              "foreground_fraction": 0.5,
              "minibatch_size": 5,
          }
      )
  
      model = RCNNTarget(self._num_classes, config, seed=0)
  
      gt_boxes = tf.constant(
          [(200, 300, 250, 390, self._placeholder_label)],
          dtype=tf.float32,
      )
  
      proposed_boxes = tf.constant(
          [
              (12, 70, 350, 540),  # noise
              (190, 310, 240, 370),  # IoU: 0.4763
              (197, 300, 252, 389),  # IoU: 0.9015
              (196, 300, 252, 389),  # IoU: 0.8859
              (197, 303, 252, 394),  # IoU: 0.8459
              (180, 310, 235, 370),  # IoU: 0.3747
              (0, 0, 400, 400),  # noise
              (197, 302, 252, 389),  # IoU: 0.8832
              (180, 310, 235, 370),  # IoU: 0.3747
              (180, 310, 235, 370),  # IoU: 0.3747
              (0, 0, 400, 400),  # noise
          ],
          dtype=tf.float32,
      )
  
      (proposals_label, bbox_targets) = self._run_rcnn_target(
          model, gt_boxes, proposed_boxes
      )
  
      foreground_number = proposals_label[proposals_label >= 1].shape[0]
      background_number = proposals_label[proposals_label == 0].shape[0]
  
      foreground_fraction = config.foreground_fraction
      minibatch_size = config.minibatch_size
  
      self.assertLessEqual(
          foreground_number,
          np.floor(foreground_fraction * minibatch_size),
      )
      self.assertGreater(foreground_number, 0)
      self.assertLessEqual(
          background_number, minibatch_size - foreground_number
      )
  
      self.assertEqual(
          proposals_label[proposals_label >= 0].shape[0],
          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 7 for calling the RCNNTargetTest obj's underlying member method code with example usage: obj.testOddMinibatchSize() without return types