code: def load_json_logs(json_logs):
      # load and convert json_logs to log_dict, key is epoch, value is a sub dict
      # keys of sub dict is different metrics, e.g. memory, bbox_mAP
      # value of sub dict is a list of corresponding values of all iterations
      log_dicts = [dict() for _ in json_logs]
      for json_log, log_dict in zip(json_logs, log_dicts):
          with open(json_log, "r") as log_file:
              epoch = 1
              for i, line in enumerate(log_file):
                  log = json.loads(line.strip())
                  val_flag = False
                  # skip lines only contains one key
                  if not len(log) > 1:
                      continue
  
                  if epoch not in log_dict:
                      log_dict[epoch] = defaultdict(list)
  
                  for k, v in log.items():
                      if "/" in k:
                          log_dict[epoch][k.split("/")[-1]].append(v)
                          val_flag = True
                      elif val_flag:
                          continue
                      else:
                          log_dict[epoch][k].append(v)
  
                  if "epoch" in log.keys():
                      epoch = log["epoch"]
  
      return log_dicts
  
file_path: mmdetection/tools/analysis_tools/analyze_logs.py
imports: import argparse
  import json
  from collections import defaultdict
  import matplotlib.pyplot
  import numpy
  import seaborn
label_desc: Use image node_id 6 for calling a global function with example usage: load_json_logs(json_logs) and returns: log_dicts