code: def load_gt(root, cls, resize_shape):
      gt = []
      gt_dir = os.path.join(root, cls, "ground_truth")
      sub_dirs = sorted(os.listdir(gt_dir))
      for sb in sub_dirs:
          for fname in sorted(os.listdir(os.path.join(gt_dir, sb))):
              temp = cv2.imread(
                  os.path.join(gt_dir, sb, fname), cv2.IMREAD_GRAYSCALE
              )
              temp = cv2.resize(
                  temp, (resize_shape[0], resize_shape[1])
              ).astype(np.bool)[None, ...]
              gt.append(temp)
      gt = np.concatenate(gt, 0)
      return gt
  
imports: import os
  import cv2
  import numpy
  from PIL import Image
  import paddle
  from paddle.io import Dataset
  from paddle.vision import transforms
  from qinspector.cvlib.workspace import register
label_desc: Use image node_id 1 for calling a global function with example usage: load_gt(root, cls, resize_shape) and returns: gt