code: def testEncodeDecode(self):
      # 1 vs 1 already equal encode and decode.
      proposal = generate_gt_boxes(1, image_size=100)
      gt_boxes = proposal
  
      deltas = self._encode(proposal, gt_boxes)
      decoded_gt_boxes = self._decode(proposal, deltas)
  
      self.assertAllEqual(deltas, np.zeros((1, 4)))
      self.assertAllClose(gt_boxes, decoded_gt_boxes)
  
      # 3 vs 3 already equal encode and decode
      proposal = generate_gt_boxes(3, image_size=100)
      gt_boxes = proposal
  
      deltas = self._encode(proposal, gt_boxes)
      decoded_gt_boxes = self._decode(proposal, deltas)
  
      self.assertAllEqual(deltas, np.zeros((3, 4)))
      self.assertAllClose(gt_boxes, decoded_gt_boxes)
  
      # 3 vs 4 different encode and decode
      proposal = generate_gt_boxes(3, image_size=100)
      gt_boxes = generate_gt_boxes(3, image_size=100)
  
      deltas = self._encode(proposal, gt_boxes)
      decoded_gt_boxes = self._decode(proposal, deltas)
  
      self.assertAllEqual(deltas.shape, (3, 4))
      self.assertAllClose(gt_boxes, decoded_gt_boxes)
  
file_path: luminoth/luminoth/utils/bbox_transform_test.py
imports: import numpy
  import tensorflow
  from luminoth.utils.bbox_transform import encode, decode, clip_boxes
  from luminoth.utils.bbox_transform_tf import encode, decode, clip_boxes
  from luminoth.utils.test.gt_boxes import generate_gt_boxes
label_desc: Use image node_id 6 for calling the BBoxTransformTest obj's underlying member method code with example usage: obj.testEncodeDecode() without return types