code: def main():
      args = parse_args()
      splits = {
          "train": [
              "2_10",
              "2_11",
              "2_12",
              "3_10",
              "3_11",
              "3_12",
              "4_10",
              "4_11",
              "4_12",
              "5_10",
              "5_11",
              "5_12",
              "6_10",
              "6_11",
              "6_12",
              "6_7",
              "6_8",
              "6_9",
              "7_10",
              "7_11",
              "7_12",
              "7_7",
              "7_8",
              "7_9",
          ],
          "val": [
              "5_15",
              "6_15",
              "6_13",
              "3_13",
              "4_14",
              "6_14",
              "5_14",
              "2_13",
              "4_15",
              "2_14",
              "5_13",
              "4_13",
              "3_14",
              "7_13",
          ],
      }
  
      dataset_path = args.dataset_path
      if args.out_dir is None:
          out_dir = osp.join("data", "potsdam")
      else:
          out_dir = args.out_dir
  
      print("Making directories...")
      if not osp.exists(osp.join(out_dir, "img_dir", "train")):
          os.makedirs(osp.join(out_dir, "img_dir", "train"))
      if not osp.exists(osp.join(out_dir, "img_dir", "val")):
          os.makedirs(osp.join(out_dir, "img_dir", "val"))
      if not osp.exists(osp.join(out_dir, "ann_dir", "train")):
          os.makedirs(osp.join(out_dir, "ann_dir", "train"))
      if not osp.exists(osp.join(out_dir, "ann_dir", "val")):
          os.makedirs(osp.join(out_dir, "ann_dir", "val"))
  
      zipp_list = glob.glob(os.path.join(dataset_path, "*.zip"))
      print("Find the data", zipp_list)
  
      for zipp in zipp_list:
          with tempfile.TemporaryDirectory(dir=args.tmp_dir) as tmp_dir:
              zip_file = zipfile.ZipFile(zipp)
              zip_file.extractall(tmp_dir)
              src_path_list = glob.glob(os.path.join(tmp_dir, "*.tif"))
              if not len(src_path_list):
                  sub_tmp_dir = os.path.join(
                      tmp_dir, os.listdir(tmp_dir)[0]
                  )
                  src_path_list = glob.glob(
                      os.path.join(sub_tmp_dir, "*.tif")
                  )
  
              for i, src_path in enumerate(src_path_list):
                  idx_i, idx_j = osp.basename(src_path).split("_")[2:4]
                  data_type = (
                      "train"
                      if f"{idx_i}_{idx_j}" in splits["train"]
                      else "val"
                  )
                  if "label" in src_path:
                      dst_dir = osp.join(out_dir, "ann_dir", data_type)
                      clip_big_image(
                          src_path, dst_dir, args, to_label=True
                      )
                  else:
                      dst_dir = osp.join(out_dir, "img_dir", data_type)
                      clip_big_image(
                          src_path, dst_dir, args, to_label=False
                      )
  
      print("Removing the temporary files...")
  
      print("Done!")
  
file_path: PaddleSeg/contrib/RSSegBenchmark/data/prepare_potsdam.py
imports: import argparse
  import glob
  import math
  import os
  import os.path
  import tempfile
  import zipfile
  import cv2
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types