code: def main():
      # read class_indict
      json_file = open(label_json_path, "r")
      class_dict = json.load(json_file)
  
      # 读取train.txt中的所有行信息，删除空行
      with open(train_txt_path, "r") as r:
          train_file_names = [
              i for i in r.read().splitlines() if len(i.strip()) > 0
          ]
      # voc信息转yolo，并将图像文件复制到相应文件夹
      translate_info(
          train_file_names, save_file_root, class_dict, "train"
      )
  
      # 读取val.txt中的所有行信息，删除空行
      with open(val_txt_path, "r") as r:
          val_file_names = [
              i for i in r.read().splitlines() if len(i.strip()) > 0
          ]
      # voc信息转yolo，并将图像文件复制到相应文件夹
      translate_info(val_file_names, save_file_root, class_dict, "val")
  
      # 创建my_data_label.names文件
      create_class_names(class_dict)
  
file_path: deep-learning-for-image-processing/pytorch_object_detection/yolov3_spp/trans_voc2yolo.py
imports: import os
  from tqdm import tqdm
  from lxml import etree
  import json
  import shutil
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types