code: def widerface_to_cocojson(root_path):
      train_gt_txt = os.path.join(
          root_path, "wider_face_split", "wider_face_train_bbx_gt.txt"
      )
      val_gt_txt = os.path.join(
          root_path, "wider_face_split", "wider_face_val_bbx_gt.txt"
      )
      train_img_dir = os.path.join(root_path, "WIDER_train", "images")
      val_img_dir = os.path.join(root_path, "WIDER_val", "images")
      assert train_gt_txt
      assert val_gt_txt
      assert train_img_dir
      assert val_img_dir
      save_path = os.path.join(root_path, "widerface_train.json")
      widerface_convert(train_gt_txt, train_img_dir, save_path)
      print(
          "Wider Face train dataset converts sucess, the json path: {}".format(
              save_path
          )
      )
      save_path = os.path.join(root_path, "widerface_val.json")
      widerface_convert(val_gt_txt, val_img_dir, save_path)
      print(
          "Wider Face val dataset converts sucess, the json path: {}".format(
              save_path
          )
      )
  
imports: import argparse
  import glob
  import json
  import os
  import os.path
  import shutil
  import xml.etree.ElementTree
  import numpy
  import PIL.ImageDraw
  from tqdm import tqdm
  import cv2
label_desc: Use image node_id 12 for calling a global function with example usage: widerface_to_cocojson(root_path) without return types