code: def get_gt_mask_from_polygons(gt_poly, pad_mask):
      out_gt_mask = []
      for polygons, padding in zip(gt_poly, pad_mask):
          height, width = int(padding[:, 0].sum()), int(
              padding[0, :].sum()
          )
          masks = []
          for obj_poly in polygons:
              rles = mask_util.frPyObjects(obj_poly, height, width)
              rle = mask_util.merge(rles)
              masks.append(
                  paddle.to_tensor(mask_util.decode(rle)).astype(
                      "float32"
                  )
              )
          masks = paddle.stack(masks)
          masks_pad = paddle.zeros(
              [masks.shape[0], pad_mask.shape[1], pad_mask.shape[2]]
          )
          masks_pad[:, :height, :width] = masks
          out_gt_mask.append(masks_pad)
      return out_gt_mask
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  import pycocotools.mask
  from ..initializer import linear_init_, constant_
  from ..transformers.utils import inverse_sigmoid
label_desc: Use image node_id 4 for calling the DETRHead obj's underlying member method code with example usage: obj.get_gt_mask_from_polygons(gt_poly, pad_mask) and returns: out_gt_mask