class_docstr: This class stores the segmentation masks for all objects in one image, in the form of polygons.
  
  Attributes:
      polygons: list[list[ndarray]]. Each ndarray is a float64 vector representing a polygon.
class_docstr_tok: ["This","class","stores","the","segmentation","masks","for","all","objects","in","one","image",",","in","the","form","of","polygons",".","Attributes",":","polygons",":","list","[","list","[","ndarray","]","]",".","Each","ndarray","is","a","float64","vector","representing","a","polygon","."]
docstr: Computes area of the mask.
  Only works with Polygons, using the shoelace formula:
  https://stackoverflow.com/questions/24467972/calculate-area-of-polygon-given-x-y-coordinates
  
  Returns:
      Tensor: a vector, area for each instance
docstr_tok: ["Computes","area","of","the","mask",".","Only","works","with","Polygons",",","using","the","shoelace","formula",":","https",":","\/\/stackoverflow.com\/questions\/24467972\/calculate-area-of-polygon-given-x-y-coordinates","Returns",":","Tensor",":","a","vector",",","area","for","each","instance"]
code: def area(self):
      """
      Computes area of the mask.
      Only works with Polygons, using the shoelace formula:
      https://stackoverflow.com/questions/24467972/calculate-area-of-polygon-given-x-y-coordinates
  
      Returns:
          Tensor: a vector, area for each instance
      """
  
      area = []
      for polygons_per_instance in self.polygons:
          area_per_instance = 0
          for p in polygons_per_instance:
              area_per_instance += polygon_area(p[0::2], p[1::2])
          area.append(area_per_instance)
  
      return torch.tensor(area)
  
imports: import copy
  import itertools
  from typing import Any, Iterator, List, Union
  import numpy
  import torch
  import torchvision
  from .boxes import Boxes
label_desc: Use image node_id 11 for calling the PolygonMasks obj's underlying member method code with example usage: obj.area() and returns: torch