code: def test_pred2dict(self, mock):
      data_sample = DetDataSample()
      data_sample.pred_instances = InstanceData()
  
      data_sample.pred_instances.bboxes = np.array([[0, 0, 1, 1]])
      data_sample.pred_instances.labels = np.array([0])
      data_sample.pred_instances.scores = torch.FloatTensor([0.9])
      res = DetInferencer("rtmdet-t").pred2dict(data_sample)
      self.assertListAlmostEqual(res["bboxes"], [[0, 0, 1, 1]])
      self.assertListAlmostEqual(res["labels"], [0])
      self.assertListAlmostEqual(res["scores"], [0.9])
  
imports: import os.path
  import tempfile
  from unittest import TestCase, mock
  from unittest.mock import Mock, patch
  import mmcv
  import mmengine
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmengine.utils import is_list_of
  from parameterized import parameterized
  from mmdet.apis import DetInferencer
  from mmdet.evaluation.functional import get_classes
  from mmdet.structures import DetDataSample
label_desc: Use image node_id 6 for calling the TestDetInferencer obj's underlying member method code with example usage: obj.test_pred2dict(mock) without return types