class_docstr: COCO evaluation metric.
  
  Evaluate AR, AP, and mAP for detection tasks including proposal/box
  detection and instance segmentation. Please refer to
  https://cocodataset.org/#detection-eval for more details.
docstr: Evaluate the model performance of the whole dataset after processing
  all batches.
  
  Args:
      size (int): Length of the entire validation dataset.
  Returns:
      dict: Evaluation metrics dict on the val dataset. The keys are the
      names of the metrics, and the values are corresponding results.
docstr_tok: ["Evaluate","the","model","performance","of","the","whole","dataset","after","processing","all","batches",".","Args",":","size","(","int",")",":","Length","of","the","entire","validation","dataset",".","Returns",":","dict",":","Evaluation","metrics","dict","on","the","val","dataset",".","The","keys","are","the","names","of","the","metrics",",","and","the","values","are","corresponding","results","."]
code: def evaluate(self, size: int = 1) -> dict:
      """Evaluate the model performance of the whole dataset after processing
      all batches.
  
      Args:
          size (int): Length of the entire validation dataset.
      Returns:
          dict: Evaluation metrics dict on the val dataset. The keys are the
          names of the metrics, and the values are corresponding results.
      """
      if len(self.results) == 0:
          warnings.warn(
              f"{self.__class__.__name__} got empty `self.results`. Please "
              "ensure that the processed results are properly added into "
              "`self.results` in `process` method."
          )
  
      results = collect_tracking_results(
          self.results, self.collect_device
      )
  
      if is_main_process():
          _metrics = self.compute_metrics(results)  # type: ignore
          # Add prefix to metric names
          if self.prefix:
              _metrics = {
                  "/".join((self.prefix, k)): v
                  for k, v in _metrics.items()
              }
          metrics = [_metrics]
      else:
          metrics = [None]  # type: ignore
  
      broadcast_object_list(metrics)
  
      # reset the results list
      self.results.clear()
      return metrics[0]
  
file_path: mmdetection/mmdet/evaluation/metrics/coco_video_metric.py
imports: import warnings
  from typing import Sequence
  from mmengine.dist import broadcast_object_list, is_main_process
  from mmdet.registry import METRICS
  from .base_video_metric import collect_tracking_results
  from .coco_metric import CocoMetric
label_desc: Use image node_id 2 for calling the CocoVideoMetric obj's underlying member method code with example usage: obj.evaluate(size) and returns: metrics