docstr: Tests that we're clipping images correctly.
  
  We test two image shapes, (1440, 900) and (900, 1440). Note we pass
  shapes as (height, width).
docstr_tok: ["Tests","that","we","'re","clipping","images","correctly",".","We","test","two","image","shapes",",","(","1440",",","900",")","and","(","900",",","1440",")",".","Note","we","pass","shapes","as","(","height",",","width",")","."]
code: def testImageClipping(self):
      """Tests that we're clipping images correctly.
  
      We test two image shapes, (1440, 900) and (900, 1440). Note we pass
      shapes as (height, width).
      """
  
      proposed_boxes = tf.constant(
          [
              (1300, 800, 1435, 870),
              (10, 1, 30, 7),
              (2, 870, 80, 898),
          ]
      )
      gt_boxes_per_class = tf.constant(
          [
              [(1320, 815, 1455, 912)],
              [(5, -8, 31, 8)],
              [(-120, 910, 78, 1040)],
          ]
      )
      bbox_pred = self._get_bbox_pred(
          proposed_boxes, gt_boxes_per_class
      )
      cls_prob = tf.constant(
          [
              (0.0, 1.0, 0.0, 0.0),
              (0.2, 0.25, 0.3, 0.25),
              (0.45, 0.0, 0.0, 0.55),
          ]
      )
  
      shape1 = (1440, 900)
      shape2 = (900, 1440)
  
      proposal_prediction_shape1 = self._run_rcnn_proposal(
          self._shared_model,
          proposed_boxes,
          bbox_pred,
          cls_prob,
          image_shape=shape1,
      )
      proposal_prediction_shape2 = self._run_rcnn_proposal(
          self._shared_model,
          proposed_boxes,
          bbox_pred,
          cls_prob,
          image_shape=shape2,
      )
      # Assertions
      self._check_proposals_are_clipped(
          proposal_prediction_shape1["objects"],
          shape1,
      )
      self._check_proposals_are_clipped(
          proposal_prediction_shape2["objects"],
          shape2,
      )
  
file_path: luminoth/luminoth/models/fasterrcnn/rcnn_proposal_test.py
imports: import tensorflow
  from easydict import EasyDict
  from luminoth.models.fasterrcnn.rcnn_proposal import RCNNProposal
  from luminoth.utils.bbox_transform_tf import encode
label_desc: Use image node_id 8 for calling the RCNNProposalTest obj's underlying member method code with example usage: obj.testImageClipping() without return types