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: Find masks that are non-empty.
  
  Returns:
      Tensor:
          a BoolTensor which represents whether each mask is empty (False) or not (True).
docstr_tok: ["Find","masks","that","are","non-empty",".","Returns",":","Tensor",":","a","BoolTensor","which","represents","whether","each","mask","is","empty","(","False",")","or","not","(","True",")","."]
code: def nonempty(self) -> torch.Tensor:
      """
      Find masks that are non-empty.
  
      Returns:
          Tensor:
              a BoolTensor which represents whether each mask is empty (False) or not (True).
      """
      keep = [1 if len(polygon) > 0 else 0 for polygon in self.polygons]
      return torch.from_numpy(np.asarray(keep, dtype=bool))
  
imports: import copy
  import itertools
  import numpy
  from typing import Any, Iterator, List, Union
  import pycocotools.mask
  import torch
  from torch import device
  from detectron2.layers.roi_align import ROIAlign
  from detectron2.utils.memory import retry_if_cuda_oom
  from .boxes import Boxes
label_desc: Use image node_id 5 for calling the PolygonMasks obj's underlying member method code with example usage: obj.nonempty() and returns: torch