code: def compute_speedup(result_dict, speed_dict):
      mode_list = [
          key for key in result_dict
      ]  # eg. ['static', 'dynamic']
      for md in mode_list:
          model_list = [
              key for key in result_dict[md]
          ]  # eg.['vgg16', 'r50']
          for m in model_list:
              run_case = [
                  key for key in result_dict[md][m]
              ]  # eg.['4n8g', '2n8g', '1n8g', '1n4g', '1n1g']
              for d in run_case:
                  precision = [key for key in result_dict[md][m][d]]
                  for p in precision:
                      batch_size_per_device = [
                          key for key in result_dict[md][m][d][p]
                      ]
                      for b in batch_size_per_device:
                          speed_up = 1.0
                          if result_dict[md][m]["1n1g"][p][b][
                              "median_speed"
                          ]:
                              speed_up = (
                                  result_dict[md][m][d][p][b][
                                      "median_speed"
                                  ]
                                  / result_dict[md][m]["1n1g"][p][b][
                                      "median_speed"
                                  ]
                              )
                          result_dict[md][m][d][p][b][
                              "speedup"
                          ] = round(speed_up, 2)
  
file_path: insightface/recognition/arcface_paddle/tools/extract_perf_logs.py
imports: import os
  import re
  import sys
  import glob
  import json
  import argparse
  import pprint
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: compute_speedup(result_dict, speed_dict) without return types