MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / polygons_to_mask

Method polygons_to_mask

utils/visualizer.py:138–141  ·  view source on GitHub ↗
(self, polygons)

Source from the content-addressed store, hash-verified

136 return res, has_holes
137
138 def polygons_to_mask(self, polygons):
139 rle = mask_util.frPyObjects(polygons, self.height, self.width)
140 rle = mask_util.merge(rle)
141 return mask_util.decode(rle)[:, :]
142
143 def area(self):
144 return self.mask.sum()

Callers 1

maskMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected