code: def mkdir(path):
      sub_dir = osp.dirname(path)
      if not osp.exists(sub_dir):
          os.makedirs(sub_dir)
  
file_path: PaddleSeg/contrib/PanopticSeg/paddlepanseg/core/predict.py
imports: import os
  import os.path
  import math
  import numpy
  import paddle
  import paddleseg
  from paddleseg.utils import logger, progbar
  from PIL import Image
  from paddlepanseg.utils.visualize import visualize_instance, visualize_semantic, visualize_panoptic
  from paddlepanseg.cvlibs import build_info_dict
  from .None import infer
label_desc: Use image node_id 1 for calling a global function with example usage: mkdir(path) without return types