code: def __call__(self, data):
      image = data["image"]
      text_polys = data["polys"]
      ignore_tags = data["ignore_tags"]
  
      h, w, _ = image.shape
      short_edge = min(h, w)
      if short_edge < self.size:
          # keep short_size >= self.size
          scale = self.size / short_edge
          image = cv2.resize(image, dsize=None, fx=scale, fy=scale)
          text_polys *= scale
  
      gt_kernels = []
      for i in range(1, self.kernel_num + 1):
          # s1->sn, from big to small
          rate = (
              1.0
              - (1.0 - self.min_shrink_ratio)
              / (self.kernel_num - 1)
              * i
          )
          text_kernel, ignore_tags = self.generate_kernel(
              image.shape[0:2], rate, text_polys, ignore_tags
          )
          gt_kernels.append(text_kernel)
  
      training_mask = np.ones(image.shape[0:2], dtype="uint8")
      for i in range(text_polys.shape[0]):
          if ignore_tags[i]:
              cv2.fillPoly(
                  training_mask,
                  text_polys[i].astype(np.int32)[np.newaxis, :, :],
                  0,
              )
  
      gt_kernels = np.array(gt_kernels)
      gt_kernels[gt_kernels > 0] = 1
  
      data["image"] = image
      data["polys"] = text_polys
      data["gt_kernels"] = gt_kernels[0:]
      data["gt_text"] = gt_kernels[0]
      data["mask"] = training_mask.astype("float32")
      return data
  
file_path: PaddleOCR/ppocr/data/imaug/make_pse_gt.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import cv2
  import numpy
  import pyclipper
  from shapely.geometry import Polygon
label_desc: Use image node_id 2 for calling the MakePseGt obj's underlying member method code with example usage: obj.__call__(data) and returns: data