code: def make_lvis_metrics(
      save_folder=None,
      filename_prefix="model_output",
      iou_types: Union[str, List[str]] = "bbox",
      summarize_to_stdout: bool = True,
      evaluator_factory: Callable[
          [Any, List[str]], DetectionEvaluator
      ] = lvis_evaluator_factory,
      gt_api_def: Sequence[
          SupportedDatasetApiDef
      ] = DEFAULT_SUPPROTED_DETECTION_DATASETS,
  ):
      """
      Returns an instance of :class:`DetectionMetrics` initialized for the LVIS
      dataset.
  
      :param save_folder: path to the folder where to write model output
              files. Defaults to None, which means that the model output of
              test instances will not be stored.
      :param filename_prefix: prefix common to all model outputs files.
          Ignored if `save_folder` is None. Defaults to "model_output"
      :param iou_types: list of (or a single string) strings describing
          the iou types to use when computing metrics.
          Defaults to "bbox". Valid values are "bbox" and "segm".
      :param summarize_to_stdout: if True, a summary of evaluation metrics
          will be printed to stdout (as a table) using the Lvis API.
          Defaults to True.
      :param evaluator_factory: Defaults to :class:`LvisEvaluator` constructor.
      :param gt_api_def: Defaults to the list of supported datasets (LVIS is
          supported in Avalanche through class:`LvisDataset`).
      :return: A metric plugin that can compute metrics on the LVIS dataset.
      """
      return DetectionMetrics(
          evaluator_factory=evaluator_factory,
          gt_api_def=gt_api_def,
          save_folder=save_folder,
          filename_prefix=filename_prefix,
          iou_types=iou_types,
          summarize_to_stdout=summarize_to_stdout,
      )
  
imports: import os
  from pathlib import Path
  import torch
  import json
  from typing import Any, Generic, List, Union, TypeVar, Tuple, Dict, TYPE_CHECKING, Type, Callable, Sequence, Optional
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from torch import Tensor
  from json import JSONEncoder
  from torch.utils.data import Subset, ConcatDataset
  from typing_extensions import Protocol
  from avalanche.evaluation import PluginMetric
  from avalanche.evaluation.metric_results import MetricValue
  from avalanche.evaluation.metric_utils import get_metric_name
label_desc: Use image node_id 4 for calling a global function with example usage: make_lvis_metrics(save_folder, filename_prefix, iou_types, summarize_to_stdout, evaluator_factory, gt_api_def) and returns: DetectionMetrics