code: def main():
      args = parse_args()
  
      if len(args.shape) == 1:
          h = w = args.shape[0]
      elif len(args.shape) == 2:
          h, w = args.shape
      else:
          raise ValueError(
              "invalid input shape, please use --shape h w"
          )
  
      input_shape = (1, 3, h, w)
  
      cfg = Config.fromfile(args.config)
      init_default_scope(cfg.get("default_scope", "mmocr"))
      model = MODELS.build(cfg.model)
  
      flops = FlopCountAnalysis(model, torch.ones(input_shape))
  
      # params = parameter_count_table(model)
      flops_data = flop_count_table(flops)
  
      print(flops_data)
  
      print(
          "!!!Please be cautious if you use the results in papers. "
          "You may need to check if all ops are supported and verify that the "
          "flops computation is correct."
      )
  
imports: import argparse
  import torch
  from fvcore.nn import FlopCountAnalysis, flop_count_table
  from mmengine import Config
  from mmengine.registry import init_default_scope
  from mmocr.registry import MODELS
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types