code: def polygons_to_bitmask(polygons, height, width):
      """converts a set of polygons into a bitmask"""
      if any(len(p) <= 4 for p in polygons):
          polygons = [p for p in polygons if len(p) > 4]
      if len(polygons) == 0:
          return np.zeros((height, width)).astype(int)
  
      rles = mask_util.frPyObjects(polygons, height, width)
      rle = mask_util.merge(rles)
      return mask_util.decode(rle).astype(int)
  
file_path: PaddleSeg/contrib/QualityInspector/qinspector/utils/visualizer.py
imports: import os
  import os.path
  import numpy
  from PIL import Image, ImageDraw
  import pycocotools.mask
  from ppdet.utils.colormap import colormap
label_desc: Use image node_id 1 for calling a global function with example usage: polygons_to_bitmask(polygons, height, width) and returns: mask_util, np