docstr: Test max pooling with bilinear interpolation.
  We have 4 'roi_proposals' and use a 'pool size'
  of 2x2 ('pooled_width': 2, 'pooled_height': 2), then we will get as
  result a 'roi_pool' of 2x2.
docstr_tok: ["Test","max","pooling","with","bilinear","interpolation",".","We","have","4","'roi_proposals","'","and","use","a","'pool","size'","of","2x2","(","'pooled_width","'",":","2",",","'pooled_height","'",":","2",")",",","then","we","will","get","as","result","a","'roi_pool","'","of","2x2","."]
code: def testMaxPoolingWithInterpolation(self):
      """
      Test max pooling with bilinear interpolation.
      We have 4 'roi_proposals' and use a 'pool size'
      of 2x2 ('pooled_width': 2, 'pooled_height': 2), then we will get as
      result a 'roi_pool' of 2x2.
      """
  
      roi_proposals = np.array(
          [
              [4, 1, 7, 4],  # Across mat_A and mat_B (1/4 - 3/4)
              [1, 4, 4, 8],  # Across mat_A and mat_C (1/4 - 3/4)
              [5, 4, 9, 8],  # Inside mat_B and mat_D (1/4 - 3/4)
              [4, 6, 7, 9],  # Inside mat_C and mat_D (1/4 - 3/4)
          ]
      )
      a = self.multiplier_a
      b = self.multiplier_b
      c = self.multiplier_c
      d = self.multiplier_d
  
      results = self._run_roi_pooling(
          roi_proposals, self.pretrained, self.config
      )
  
      results["roi_pool"] = np.squeeze(results["roi_pool"], axis=3)
  
      # Check that max polling returns values greater or equal
      # than 'a' and crops returns values lower or equal than 'b'
      self.assertTrue(np.greater_equal(results["roi_pool"][0], a).all())
  
      self.assertTrue(np.less_equal(results["crops"][0], b).all())
  
      # Check that max polling returns values greater or equal
      # than 'a' and crops returns values lower or equal than 'c'
      self.assertTrue(np.greater_equal(results["roi_pool"][1], a).all())
  
      self.assertTrue(np.less_equal(results["crops"][1], c).all())
  
      # Check that max polling returns values greater or equal
      # than 'b' and crops returns values lower or equal than 'd'
      self.assertTrue(np.greater_equal(results["roi_pool"][2], b).all())
  
      self.assertTrue(np.less_equal(results["crops"][2], d).all())
  
      # Check that max polling returns values greater or equal
      # than 'c' and crops returns values lower or equal than 'd'
      self.assertTrue(np.greater_equal(results["roi_pool"][3], c).all())
  
      self.assertTrue(np.less_equal(results["crops"][3], d).all())
  
file_path: luminoth/luminoth/models/fasterrcnn/roi_pool_test.py
imports: import numpy
  import tensorflow
  from easydict import EasyDict
  from luminoth.models.fasterrcnn.roi_pool import ROIPoolingLayer
label_desc: Use image node_id 5 for calling the ROIPoolingTest obj's underlying member method code with example usage: obj.testMaxPoolingWithInterpolation() without return types