code: def test_convert_original_predictions_with_mask_output(self):
      from sahi.models.mmdet import MmdetDetectionModel
  
      # init model
      download_mmdet_cascade_mask_rcnn_model()
  
      mmdet_detection_model = MmdetDetectionModel(
          model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH,
          config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH,
          confidence_threshold=CONFIDENCE_THRESHOLD,
          device=MODEL_DEVICE,
          category_remapping=None,
          load_at_init=True,
          image_size=IMAGE_SIZE,
      )
  
      # prepare image
      image = read_image(IMAGE_PATH)
  
      # perform inference
      mmdet_detection_model.perform_inference(image)
  
      # convert predictions to ObjectPrediction list
      mmdet_detection_model.convert_original_predictions()
      object_predictions = mmdet_detection_model.object_prediction_list
  
      # compare
      self.assertEqual(len(object_predictions), 3)
      self.assertEqual(object_predictions[0].category.id, 2)
      self.assertEqual(object_predictions[0].category.name, "car")
      self.assertEqual(
          object_predictions[0].bbox.to_xywh(),
          [448, 308, 41, 36],
      )
      self.assertEqual(object_predictions[2].category.id, 2)
      self.assertEqual(object_predictions[2].category.name, "car")
      self.assertEqual(
          object_predictions[2].bbox.to_xywh(),
          [381, 280, 33, 30],
      )
      for object_prediction in object_predictions:
          self.assertGreaterEqual(
              object_prediction.score.value, CONFIDENCE_THRESHOLD
          )
  
file_path: sahi/tests/test_mmdetectionmodel.py
imports: import unittest
  import numpy
  from sahi.utils.cv import read_image
  from sahi.utils.file import download_from_url
  from sahi.utils.mmdet import MmdetTestConstants, download_mmdet_cascade_mask_rcnn_model, download_mmdet_yolox_tiny_model
label_desc: Use image node_id 4 for calling the TestMmdetDetectionModel obj's underlying member method code with example usage: obj.test_convert_original_predictions_with_mask_output() without return types