class_docstr: The inference benchmark class. It will be statistical inference FPS,
  CUDA memory and CPU memory information.
  
  Args:
      cfg (mmengine.Config): config.
      checkpoint (str): Accept local filepath, URL, ``torchvision://xxx``,
          ``open-mmlab://xxx``.
      distributed (bool): distributed testing flag.
      is_fuse_conv_bn (bool): Whether to fuse conv and bn, this will
          slightly increase the inference speed.
      max_iter (int): maximum iterations of benchmark. Defaults to 2000.
      log_interval (int): interval of logging. Defaults to 50.
      num_warmup (int): Number of Warmup. Defaults to 5.
      logger (MMLogger, optional): Formatted logger used to record messages.
class_docstr_tok: ["The","inference","benchmark","class",".","It","will","be","statistical","inference","FPS",",","CUDA","memory","and","CPU","memory","information",".","Args",":","cfg","(","mmengine.Config",")",":","config",".","checkpoint","(","str",")",":","Accept","local","filepath",",","URL",",","``","torchvision",":","\/\/xxx","``",",","``","open-mmlab",":","\/\/xxx","``",".","distributed","(","bool",")",":","distributed","testing","flag",".","is_fuse_conv_bn","(","bool",")",":","Whether","to","fuse","conv","and","bn",",","this","will","slightly","increase","the","inference","speed",".","max_iter","(","int",")",":","maximum","iterations","of","benchmark",".","Defaults","to","2000.","log_interval","(","int",")",":","interval","of","logging",".","Defaults","to","50.","num_warmup","(","int",")",":","Number","of","Warmup",".","Defaults","to","5.","logger","(","MMLogger",",","optional",")",":","Formatted","logger","used","to","record","messages","."]
docstr: Average the results of multiple runs.
docstr_tok: ["Average","the","results","of","multiple","runs","."]
code: def average_multiple_runs(self, results: List[dict]) -> dict:
      """Average the results of multiple runs."""
      print_log("============== Done ==================", self.logger)
  
      fps_list_ = [round(result["fps"], 1) for result in results]
      avg_fps_ = sum(fps_list_) / len(fps_list_)
      outputs = {"avg_fps": avg_fps_, "fps_list": fps_list_}
  
      if len(fps_list_) > 1:
          times_pre_image_list_ = [
              round(1000 / result["fps"], 1) for result in results
          ]
          avg_times_pre_image_ = sum(times_pre_image_list_) / len(
              times_pre_image_list_
          )
  
          print_log(
              f"Overall fps: {fps_list_}[{avg_fps_:.1f}] img/s, "
              "times per image: "
              f"{times_pre_image_list_}[{avg_times_pre_image_:.1f}] "
              "ms/img",
              self.logger,
          )
      else:
          print_log(
              f"Overall fps: {fps_list_[0]:.1f} img/s, "
              f"times per image: {1000 / fps_list_[0]:.1f} ms/img",
              self.logger,
          )
  
      print_log(f"cuda memory: {get_max_cuda_memory()} MB", self.logger)
      print_process_memory(self._process, self.logger)
  
      return outputs
  
imports: import copy
  import time
  from functools import partial
  from typing import List, Optional, Union
  import numpy
  import torch
  import torch.nn
  from mmcv.cnn import fuse_conv_bn
  from mmengine import MMLogger
  from mmengine.config import Config
  from mmengine.device import get_max_cuda_memory
  from mmengine.dist import get_world_size
  from mmengine.runner import Runner, load_checkpoint
  from mmengine.utils.dl_utils import set_multi_processing
  from torch.nn.parallel import DistributedDataParallel
  from mmdet.registry import DATASETS, MODELS
label_desc: Use image node_id 4 for calling the InferenceBenchmark obj's underlying member method code with example usage: obj.average_multiple_runs(results) and returns: outputs