docstr: Compute COCO metrics
  
  Args:
      results_list (list[dict[int, dict[str, np.ndarray]]]): list with results per image (in list)
          per category (dict). Inner dict contains multiple results obtained by :func:`box_matching_batch`.
  
          - `dtMatches`: matched detections [T, D], where T = number of
            thresholds, D = number of detections
          - `gtMatches`: matched ground truth boxes [T, G], where T = number
            of thresholds, G = number of ground truth
          - `dtScores`: prediction scores [D] detection scores
          - `gtIgnore`: ground truth boxes which should be ignored
            [G] indicate whether ground truth should be ignored
          - `dtIgnore`: detections which should be ignored [T, D],
            indicate which detections should be ignored
  
  Returns:
      dict[str, float], dictionary with coco metrics
docstr_tok: ["Compute","COCO","metrics","Args",":","results_list","(","list","[","dict","[","int",",","dict","[","str",",","np.ndarray","]","]","]",")",":","list","with","results","per","image","(","in","list",")","per","category","(","dict",")",".","Inner","dict","contains","multiple","results","obtained","by",":","func",":","`","box_matching_batch","`",".","-","`","dtMatches","`",":","matched","detections","[","T",",","D","]",",","where","T","=","number","of","thresholds",",","D","=","number","of","detections","-","`","gtMatches","`",":","matched","ground","truth","boxes","[","T",",","G","]",",","where","T","=","number","of","thresholds",",","G","=","number","of","ground","truth","-","`","dtScores","`",":","prediction","scores","[","D","]","detection","scores","-","`","gtIgnore","`",":","ground","truth","boxes","which","should","be","ignored","[","G","]","indicate","whether","ground","truth","should","be","ignored","-","`","dtIgnore","`",":","detections","which","should","be","ignored","[","T",",","D","]",",","indicate","which","detections","should","be","ignored","Returns",":","dict","[","str",",","float","]",",","dictionary","with","coco","metrics"]
code: def compute(
      self, results_list: list[dict[int, dict[str, np.ndarray]]]
  ) -> tuple[dict[str, float], None]:
      """
      Compute COCO metrics
  
      Args:
          results_list (list[dict[int, dict[str, np.ndarray]]]): list with results per image (in list)
              per category (dict). Inner dict contains multiple results obtained by :func:`box_matching_batch`.
  
              - `dtMatches`: matched detections [T, D], where T = number of
                thresholds, D = number of detections
              - `gtMatches`: matched ground truth boxes [T, G], where T = number
                of thresholds, G = number of ground truth
              - `dtScores`: prediction scores [D] detection scores
              - `gtIgnore`: ground truth boxes which should be ignored
                [G] indicate whether ground truth should be ignored
              - `dtIgnore`: detections which should be ignored [T, D],
                indicate which detections should be ignored
  
      Returns:
          dict[str, float], dictionary with coco metrics
      """
      if self.verbose:
          logger.info("Start COCO metric computation...")
          tic = time.time()
  
      dataset_statistics = self._compute_statistics(
          results_list=results_list
      )  # dict[str, Union[np.ndarray, list]]
  
      if self.verbose:
          toc = time.time()
          logger.info(
              f"Statistics for COCO metrics finished (t={(toc - tic):0.2f}s)."
          )
  
      results = {}
      results.update(self._compute_ap(dataset_statistics))
      results.update(self._compute_ar(dataset_statistics))
  
      if self.verbose:
          toc = time.time()
          logger.info(
              f"COCO metrics computed in t={(toc - tic):0.2f}s."
          )
      return results, None
  
file_path: MONAI/monai/apps/detection/metrics/coco.py
imports: from __future__ import annotations
  import logging
  import time
  from collections.abc import Sequence
  from typing import Any
  import numpy
label_desc: Use image node_id 5 for calling the COCOMetric obj's underlying member method code with example usage: obj.compute(results_list) and returns: results,  None