code: def main():
      args = parse_args()
      cityscapes_path = args.cityscapes_path
      out_dir = args.out_dir if args.out_dir else cityscapes_path
      mkdir_or_exist(out_dir)
  
      img_dir = osp.join(cityscapes_path, args.img_dir)
      gt_dir = osp.join(cityscapes_path, args.gt_dir)
  
      set_name = dict(
          train="instancesonly_filtered_gtFine_train.json",
          val="instancesonly_filtered_gtFine_val.json",
          test="instancesonly_filtered_gtFine_test.json",
      )
  
      for split, json_name in set_name.items():
          print(f"Converting {split} into {json_name}")
          with Timer(
              print_tmpl="It took {}s to convert Cityscapes annotation"
          ):
              files = collect_files(
                  osp.join(img_dir, split), osp.join(gt_dir, split)
              )
              image_infos = collect_annotations(files, nproc=args.nproc)
              cvt_annotations(image_infos, osp.join(out_dir, json_name))
  
file_path: mmdetection/tools/dataset_converters/cityscapes.py
imports: import argparse
  import glob
  import os.path
  import cityscapesscripts.helpers.labels
  import mmcv
  import numpy
  import pycocotools.mask
  from mmengine.fileio import dump
  from mmengine.utils import Timer, mkdir_or_exist, track_parallel_progress, track_progress
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types