code: def draw_annotation(img, boxes, klass, polygons=None, is_crowd=None):
      """Will not modify img"""
      labels = []
      assert len(boxes) == len(klass)
      if is_crowd is not None:
          assert len(boxes) == len(is_crowd)
          for cls, crd in zip(klass, is_crowd):
              clsname = cfg.DATA.CLASS_NAMES[cls]
              if crd == 1:
                  clsname += ";Crowd"
              labels.append(clsname)
      else:
          for cls in klass:
              labels.append(cfg.DATA.CLASS_NAMES[cls])
      img = viz.draw_boxes(img, boxes, labels)
  
      if polygons is not None:
          for p in polygons:
              mask = polygons_to_mask(p, img.shape[0], img.shape[1])
              img = draw_mask(img, mask)
      return img
  
file_path: tensorpack/examples/FasterRCNN/viz.py
imports: import numpy
  from tensorpack.utils import viz
  from tensorpack.utils.palette import PALETTE_RGB
  from config import config
  from utils.np_box_ops import area
  from utils.np_box_ops import iou
  from common import polygons_to_mask
label_desc: Use image node_id 1 for calling a global function with example usage: draw_annotation(img, boxes, klass, polygons, is_crowd) and returns: img