code: def main():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--dataset_type",
          help="the type of dataset, can be `uwmgi` or `coco`",
          type=str,
      )
      parser.add_argument(
          "--zip_input",
          help="the directory of original dataset zip file",
          type=str,
      )
      parser.add_argument(
          "--img_input",
          help="the directory of original dataset image file",
          type=str,
      )
      parser.add_argument(
          "--ann_input",
          help="the directory of original dataset annotation file",
          type=str,
      )
      parser.add_argument(
          "--output",
          help="the directory to save converted dataset",
          type=str,
      )
      parser.add_argument(
          "--train_proportion",
          help="the proportion of train dataset",
          type=float,
          default=0.8,
      )
      parser.add_argument(
          "--val_proportion",
          help="the proportion of validation dataset",
          type=float,
          default=0.2,
      )
      args = parser.parse_args()
  
      assert args.dataset_type in [
          "uwmgi",
          "coco",
      ], "Now only support the `uwmgi` and `coco`!!!"
  
      assert 0 <= args.train_proportion <= 1
      assert 0 <= args.val_proportion <= 1
      assert args.train_proportion + args.val_proportion == 1
  
      if not os.path.exists(args.output):
          os.makedirs(args.output, exist_ok=True)
  
      os.makedirs(
          os.path.join(args.output, "images/train"), exist_ok=True
      )
      os.makedirs(
          os.path.join(args.output, "annotations/train"), exist_ok=True
      )
      os.makedirs(
          os.path.join(args.output, "images/val"), exist_ok=True
      )
      os.makedirs(
          os.path.join(args.output, "annotations/val"), exist_ok=True
      )
  
      if args.dataset_type == "uwmgi":
          assert os.path.exists(args.zip_input), (
              f"The directory({args.zip_input}) of "
              f"original UWMGI dataset does not exist!"
          )
          assert zipfile.is_zipfile(args.zip_input)
  
          uwmgi_to_multilabel_format(args)
  
      else:  # args.dataset_type == 'coco'
          assert os.path.exists(args.img_input), (
              f"The directory({args.img_input}) of "
              f"original image file does not exist!"
          )
          assert os.path.exists(args.ann_input), (
              f"The directory({args.ann_input}) of "
              f"original annotation file does not exist!"
          )
  
          coco_to_multilabel_format(args)
  
      print(
          "Dataset converts success, the data path: {}".format(
              args.output
          )
      )
  
file_path: PaddleSeg/tools/data/convert_multilabel.py
imports: import argparse
  import os
  import random
  import zipfile
  import cv2
  import numpy
  import pandas
  from PIL import Image
  from pycocotools.coco import COCO
  from tqdm import tqdm
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types