code: def test_eval_instance_segmentation_coco(self):
      pred_masks = self.result["masks"]
      pred_labels = self.result["labels"]
      pred_scores = self.result["scores"]
  
      gt_masks = self.dataset["masks"]
      gt_labels = self.dataset["labels"]
      gt_crowdeds = self.dataset["crowdeds"]
      gt_areas = self.dataset["areas"]
  
      result = eval_instance_segmentation_coco(
          pred_masks,
          pred_labels,
          pred_scores,
          gt_masks,
          gt_labels,
          gt_areas,
          gt_crowdeds,
      )
  
      expected = {
          "map/iou=0.50:0.95/area=all/max_dets=100": 0.32170935,
          "map/iou=0.50/area=all/max_dets=100": 0.56469292,
          "map/iou=0.75/area=all/max_dets=100": 0.30133106,
          "map/iou=0.50:0.95/area=small/max_dets=100": 0.38737403,
          "map/iou=0.50:0.95/area=medium/max_dets=100": 0.31018272,
          "map/iou=0.50:0.95/area=large/max_dets=100": 0.32693391,
          "mar/iou=0.50:0.95/area=all/max_dets=1": 0.27037258,
          "mar/iou=0.50:0.95/area=all/max_dets=10": 0.41759154,
          "mar/iou=0.50:0.95/area=all/max_dets=100": 0.41898236,
          "mar/iou=0.50:0.95/area=small/max_dets=100": 0.46944986,
          "mar/iou=0.50:0.95/area=medium/max_dets=100": 0.37675923,
          "mar/iou=0.50:0.95/area=large/max_dets=100": 0.38147151,
      }
  
      non_existent_labels = np.setdiff1d(
          np.arange(max(result["existent_labels"])),
          result["existent_labels"],
      )
      for key, item in expected.items():
          non_mean_key = key[1:]
          self.assertIsInstance(result[non_mean_key], np.ndarray)
          self.assertEqual(result[non_mean_key].shape, (80,))
          self.assertTrue(
              np.all(
                  np.isnan(result[non_mean_key][non_existent_labels])
              )
          )
          np.testing.assert_almost_equal(
              result[key], expected[key], decimal=5
          )
  
imports: import numpy
  import os
  from six.moves.urllib import request
  import unittest
  from chainer import testing
  from chainercv.evaluations import eval_instance_segmentation_coco
label_desc: Use image node_id 2 for calling the TestEvalInstanceSegmentationCOCO obj's underlying member method code with example usage: obj.test_eval_instance_segmentation_coco() without return types