docstr: Test basic output of the FasterCnnNetwork
docstr_tok: ["Test","basic","output","of","the","FasterCnnNetwork"]
code: def testBasic(self):
      """
      Test basic output of the FasterCnnNetwork
      """
      results = self._run_network()
      class_prediction = results["classification_prediction"]
      rpn_prediction = results["rpn_prediction"]
  
      # Check that every object is defined by 4 coordinates
      self.assertEqual(class_prediction["objects"].shape[1], 4)
  
      # Check we get objects clipped to the image.
      self.assertAllEqual(
          clip_boxes(class_prediction["objects"], self.image_size),
          class_prediction["objects"],
      )
  
      self.assertEqual(
          class_prediction["labels"].shape[0],
          class_prediction["objects"].shape[0],
      )
  
      # Check that every object label is less or equal than 'num_classes'
      self.assertTrue(
          np.less_equal(
              class_prediction["labels"],
              self.config.model.network.num_classes,
          ).all()
      )
  
      # Check that the sum of class probabilities is 1
      self.assertAllClose(
          np.sum(class_prediction["rcnn"]["cls_prob"], axis=1),
          np.ones((class_prediction["rcnn"]["cls_prob"].shape[0])),
      )
  
      # Check that the sum of rpn class probabilities is 1
      self.assertAllClose(
          np.sum(rpn_prediction["rpn_cls_prob"], axis=1),
          np.ones((rpn_prediction["rpn_cls_prob"].shape[0])),
      )
  
      # Check that every rpn proposal has 4 coordinates
      self.assertEqual(rpn_prediction["proposals"].shape[1], 4)
  
      # Check we get rpn proposals clipped to the image.
      self.assertAllEqual(
          clip_boxes(rpn_prediction["proposals"], self.image_size),
          rpn_prediction["proposals"],
      )
  
file_path: luminoth/luminoth/models/fasterrcnn/fasterrcnn_test.py
imports: import numpy
  import tensorflow
  from easydict import EasyDict
  from luminoth.models.fasterrcnn import FasterRCNN
  from luminoth.utils.bbox_transform import clip_boxes
label_desc: Use image node_id 5 for calling the FasterRCNNNetworkTest obj's underlying member method code with example usage: obj.testBasic() without return types