code: def test_evaluate_without_json(self):
      dummy_pred = self._create_dummy_results()
  
      dummy_mask = np.zeros((10, 10), order="F", dtype=np.uint8)
      dummy_mask[:5, :5] = 1
      rle_mask = mask_util.encode(dummy_mask)
      rle_mask["counts"] = rle_mask["counts"].decode("utf-8")
      instances = [
          {
              "bbox_label": 0,
              "bbox": [50, 60, 70, 80],
              "ignore_flag": 0,
              "mask": rle_mask,
          },
          {
              "bbox_label": 0,
              "bbox": [100, 120, 130, 150],
              "ignore_flag": 0,
              "mask": rle_mask,
          },
          {
              "bbox_label": 1,
              "bbox": [150, 160, 190, 200],
              "ignore_flag": 0,
              "mask": rle_mask,
          },
          {
              "bbox_label": 0,
              "bbox": [250, 260, 350, 360],
              "ignore_flag": 0,
              "mask": rle_mask,
          },
      ]
      coco_metric = CocoMetric(
          ann_file=None,
          metric=["bbox", "segm"],
          classwise=False,
          outfile_prefix=f"{self.tmp_dir.name}/test",
      )
      coco_metric.dataset_meta = dict(classes=["car", "bicycle"])
      coco_metric.process(
          {},
          [
              dict(
                  pred_instances=dummy_pred,
                  img_id=0,
                  ori_shape=(640, 640),
                  instances=instances,
              )
          ],
      )
      eval_results = coco_metric.evaluate(size=1)
      print(eval_results)
      target = {
          "coco/bbox_mAP": 1.0,
          "coco/bbox_mAP_50": 1.0,
          "coco/bbox_mAP_75": 1.0,
          "coco/bbox_mAP_s": 1.0,
          "coco/bbox_mAP_m": 1.0,
          "coco/bbox_mAP_l": 1.0,
          "coco/segm_mAP": 1.0,
          "coco/segm_mAP_50": 1.0,
          "coco/segm_mAP_75": 1.0,
          "coco/segm_mAP_s": 1.0,
          "coco/segm_mAP_m": 1.0,
          "coco/segm_mAP_l": 1.0,
      }
      self.assertDictEqual(eval_results, target)
      self.assertTrue(
          osp.isfile(osp.join(self.tmp_dir.name, "test.bbox.json"))
      )
      self.assertTrue(
          osp.isfile(osp.join(self.tmp_dir.name, "test.segm.json"))
      )
      self.assertTrue(
          osp.isfile(osp.join(self.tmp_dir.name, "test.gt.json"))
      )
  
imports: import os.path
  import tempfile
  from unittest import TestCase
  import numpy
  import pycocotools.mask
  import torch
  from mmengine.fileio import dump
  from mmdet.evaluation import CocoMetric
label_desc: Use image node_id 12 for calling the TestCocoMetric obj's underlying member method code with example usage: obj.test_evaluate_without_json() without return types