code: def main():
      args = parse_args()
  
      if len(args.shape) == 1:
          input_shape = (3, args.shape[0], args.shape[0])
      elif len(args.shape) == 2:
          input_shape = (3,) + tuple(args.shape)
      else:
          raise ValueError("invalid input shape")
  
      cfg = Config.fromfile(args.config)
      # import modules from string list.
      if cfg.get("custom_imports", None):
          from mmcv.utils import import_modules_from_strings
  
          import_modules_from_strings(**cfg["custom_imports"])
  
      model = build_detector(
          cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg
      )
      if torch.cuda.is_available():
          model.cuda()
      model.eval()
      # print(model.bbox_head)
  
      if hasattr(model, "forward_dummy"):
          model.forward = model.forward_dummy
      else:
          raise NotImplementedError(
              "FLOPs counter is currently not currently supported with {}".format(
                  model.__class__.__name__
              )
          )
  
      # flops, params = get_model_complexity_info(model, input_shape)
      flops, params = get_model_complexity_info(
          model,
          input_shape,
          print_per_layer_stat=True,
          as_strings=False,
      )
      flops += model.bbox_head.extra_flops
      flops *= 0.75
      split_line = "=" * 30
      print("ON VGA:")
      print(flops / 1e9, "G")
      print(params / 1e6, "M")
  
imports: import argparse
  import torch
  from mmcv import Config
  from mmdet.models import build_detector
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types