code: def genGtFile(seqPath, outPath, classes=[]):
      id_idx = 0
      old_idx = -1
      with open(seqPath, "r") as singleSeqFile:
          motLine = []
          allLines = singleSeqFile.readlines()
          for line in allLines:
              line = line.replace("\n", "")
              line = line.split(",")
              # exclude occlusion!='2'
              if line[-1] != "2" and line[7] in classes:
                  if old_idx != int(line[1]):
                      id_idx += 1
                      old_idx = int(line[1])
                  newLine = line[0:6]
                  newLine[1] = str(id_idx)
                  newLine.append("1")
                  if len(classes) > 1 and isExtractMultiClass:
                      class_index = str(classes.index(line[7]) + 1)
                      newLine.append(class_index)
                  else:
                      newLine.append("1")  # use permanent class '1'
                  newLine.append("1")
                  motLine.append(newLine)
          mkdir_if_missing(outPath)
          gtFilePath = osp.join(outPath, "gt.txt")
          with open(gtFilePath, "w") as gtFile:
              motLine = list(map(lambda x: str.join(",", x), motLine))
              motLineStr = str.join("\n", motLine)
              gtFile.write(motLineStr)
  
file_path: PaddleDetection/configs/mot/pedestrian/tools/visdrone/visdrone2mot.py
imports: import glob
  import os
  import os.path
  import cv2
  import argparse
  import numpy
  import random
label_desc: Use image node_id 2 for calling a global function with example usage: genGtFile(seqPath, outPath, classes) without return types