class_docstr: Attribute:
      polygons (list[ndarray]): list[ndarray]: polygons for this mask.
          Each ndarray has format [x, y, x, y, ...]
      mask (ndarray): a binary mask
class_docstr_tok: ["Attribute",":","polygons","(","list","[","ndarray","]",")",":","list","[","ndarray","]",":","polygons","for","this","mask",".","Each","ndarray","has","format","[","x",",","y",",","x",",","y",",","...","]","mask","(","ndarray",")",":","a","binary","mask"]
code: def polygons(self):
      if self._polygons is None:
          self._polygons, self._has_holes = self.mask_to_polygons(
              self._mask
          )
      return self._polygons
  
imports: import colorsys
  import logging
  import math
  import numpy
  from enum import Enum, unique
  import cv2
  import matplotlib
  import matplotlib.colors
  import matplotlib.figure
  import pycocotools.mask
  import torch
  from matplotlib.backends.backend_agg import FigureCanvasAgg
  from PIL import Image
  from detectron2.data import MetadataCatalog
  from detectron2.structures import BitMasks, Boxes, BoxMode, Keypoints, PolygonMasks, RotatedBoxes
  from detectron2.utils.file_io import PathManager
  from .colormap import random_color
label_desc: Use image node_id 3 for calling the GenericMask obj's underlying member method code with example usage: obj.polygons() and returns: self