class_docstr: mAP evaluation metrics for the VIS task.
  
  Args:
      metric (str | list[str]): Metrics to be evaluated.
          Default value is `youtube_vis_ap`.
      metric_items (List[str], optional): Metric result names to be
          recorded in the evaluation result. Defaults to None.
      outfile_prefix (str | None): The prefix of json files. It includes
          the file path and the prefix of filename, e.g., "a/b/prefix".
          If not specified, a temp file will be created. Defaults to None.
      collect_device (str): Device name used for collecting results from
          different ranks during distributed training. Must be 'cpu' or
          'gpu'. Defaults to 'cpu'.
      prefix (str, optional): The prefix that will be added in the metric
          names to disambiguate homonyms metrics of different evaluators.
          If prefix is not provided in the argument, self.default_prefix
          will be used instead. Default: None
      format_only (bool): If True, only formatting the results to the
          official format and not performing evaluation. Defaults to False.
code: def __init__(
      self,
      metric: Union[str, List[str]] = "youtube_vis_ap",
      metric_items: Optional[Sequence[str]] = None,
      outfile_prefix: Optional[str] = None,
      collect_device: str = "cpu",
      prefix: Optional[str] = None,
      format_only: bool = False,
  ) -> None:
      super().__init__(collect_device=collect_device, prefix=prefix)
      # vis evaluation metrics
      self.metrics = metric if isinstance(metric, list) else [metric]
      self.format_only = format_only
      allowed_metrics = ["youtube_vis_ap"]
      for metric in self.metrics:
          if metric not in allowed_metrics:
              raise KeyError(
                  f"metric should be 'youtube_vis_ap', but got {metric}."
              )
  
      self.metric_items = metric_items
      self.outfile_prefix = outfile_prefix
      self.per_video_res = []
      self.categories = []
      self._vis_meta_info = defaultdict(list)
  
imports: import os.path
  import tempfile
  import warnings
  import zipfile
  from collections import OrderedDict, defaultdict
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import mmengine
  import numpy
  from mmengine.dist import all_gather_object, barrier, broadcast_object_list, is_main_process
  from mmengine.logging import MMLogger
  from mmdet.registry import METRICS
  from mmdet.structures.mask import encode_mask_results
  from ..functional import YTVIS, YTVISeval
  from .base_video_metric import BaseVideoMetric, collect_tracking_results
label_desc: Use image node_id 1 to create a new YouTubeVISMetric object from inherited base classes: BaseVideoMetric with example: obj = YouTubeVISMetric(metric, metric_items, outfile_prefix, collect_device, prefix, format_only)