code: def test_eval_detection_coco(self):
      pred_bboxes = self.result["bboxes"]
      pred_labels = self.result["labels"]
      pred_scores = self.result["scores"]
  
      gt_bboxes = self.dataset["bboxes"]
      gt_labels = self.dataset["labels"]
      gt_areas = self.dataset["areas"]
      gt_crowdeds = self.dataset["crowdeds"]
  
      result = eval_detection_coco(
          pred_bboxes,
          pred_labels,
          pred_scores,
          gt_bboxes,
          gt_labels,
          gt_areas,
          gt_crowdeds,
      )
  
      expected = {
          "map/iou=0.50:0.95/area=all/max_dets=100": 0.5069852,
          "map/iou=0.50/area=all/max_dets=100": 0.69937725,
          "map/iou=0.75/area=all/max_dets=100": 0.57538619,
          "map/iou=0.50:0.95/area=small/max_dets=100": 0.58562572,
          "map/iou=0.50:0.95/area=medium/max_dets=100": 0.51939969,
          "map/iou=0.50:0.95/area=large/max_dets=100": 0.5013979,
          "mar/iou=0.50:0.95/area=all/max_dets=1": 0.38919373,
          "mar/iou=0.50:0.95/area=all/max_dets=10": 0.59606053,
          "mar/iou=0.50:0.95/area=all/max_dets=100": 0.59773394,
          "mar/iou=0.50:0.95/area=small/max_dets=100": 0.63981096,
          "mar/iou=0.50:0.95/area=medium/max_dets=100": 0.5664206,
          "mar/iou=0.50:0.95/area=large/max_dets=100": 0.5642906,
      }
  
      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_detection_coco
label_desc: Use image node_id 2 for calling the TestEvalDetectionCOCO obj's underlying member method code with example usage: obj.test_eval_detection_coco() without return types