code: def parse_gts(gts, is_mot15):
      outputs = defaultdict(list)
      for gt in gts:
          gt = gt.strip().split(",")
          frame_id, ins_id = map(int, gt[:2])
          bbox = list(map(float, gt[2:6]))
          if is_mot15:
              conf = 1.0
              category_id = 1
              visibility = 1.0
          else:
              conf = float(gt[6])
              category_id = int(gt[7])
              visibility = float(gt[8])
          anns = dict(
              category_id=category_id,
              bbox=bbox,
              area=bbox[2] * bbox[3],
              iscrowd=False,
              visibility=visibility,
              mot_instance_id=ins_id,
              mot_conf=conf,
          )
          outputs[frame_id].append(anns)
      return outputs
  
file_path: mmdetection/tools/dataset_converters/mot2coco.py
imports: import argparse
  import os
  import os.path
  from collections import defaultdict
  import mmengine
  import numpy
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: parse_gts(gts, is_mot15) and returns: outputs