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: Initialize the model.
docstr_tok: ["Initialize","the","model","."]
code: def _init_model(
      self, checkpoint: str, is_fuse_conv_bn: bool
  ) -> nn.Module:
      """Initialize the model."""
      model = MODELS.build(self.cfg.model)
      # TODO need update
      # fp16_cfg = self.cfg.get('fp16', None)
      # if fp16_cfg is not None:
      #     wrap_fp16_model(model)
  
      load_checkpoint(model, checkpoint, map_location="cpu")
      if is_fuse_conv_bn:
          model = fuse_conv_bn(model)
  
      model = model.cuda()
  
      if self.distributed:
          model = DistributedDataParallel(
              model,
              device_ids=[torch.cuda.current_device()],
              broadcast_buffers=False,
              find_unused_parameters=False,
          )
  
      model.eval()
      return model
  
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 2 for calling the InferenceBenchmark obj's underlying member method code with example usage: obj._init_model(checkpoint, is_fuse_conv_bn) and returns: model