code: def __call__(self, x, curr_iter):
      self.prob = self.st_prob * min(
          1, 1.0 * curr_iter / self.upper_iter
      )
      if np.random.rand() > self.prob:
          return x
      h, w, _ = x.shape
      hh = int(1.5 * h)
      ww = int(1.5 * w)
      d = np.random.randint(2, h)
      self.l = min(max(int(d * self.ratio + 0.5), 1), d - 1)
      mask = np.ones((hh, ww), np.float32)
      st_h = np.random.randint(d)
      st_w = np.random.randint(d)
      if self.use_h:
          for i in range(hh // d):
              s = d * i + st_h
              t = min(s + self.l, hh)
              mask[s:t, :] *= 0
      if self.use_w:
          for i in range(ww // d):
              s = d * i + st_w
              t = min(s + self.l, ww)
              mask[:, s:t] *= 0
  
      r = np.random.randint(self.rotate)
      mask = Image.fromarray(np.uint8(mask))
      mask = mask.rotate(r)
      mask = np.asarray(mask)
      mask = mask[
          (hh - h) // 2 : (hh - h) // 2 + h,
          (ww - w) // 2 : (ww - w) // 2 + w,
      ].astype(np.float32)
  
      if self.mode == 1:
          mask = 1 - mask
      mask = np.expand_dims(mask, axis=-1)
      if self.offset:
          offset = (2 * (np.random.rand(h, w) - 0.5)).astype(np.float32)
          x = (x * mask + offset * (1 - mask)).astype(x.dtype)
      else:
          x = (x * mask).astype(x.dtype)
  
      return x
  
file_path: PaddleDetection/ppdet/data/transform/gridmask_utils.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import numpy
  from PIL import Image
label_desc: Use image node_id 2 for calling the Gridmask obj's underlying member method code with example usage: obj.__call__(x, curr_iter) and returns: x, x