polimorfo.utils package

Submodules

polimorfo.utils.datautils module

polimorfo.utils.imageutils module

polimorfo.utils.maskutils module

polimorfo.utils.maskutils.mask_to_polygon(mask, min_score: float = 0.5, approx: float = 0.01, relative: bool = True)[source]

generate polygons from masks

Args:

mask (np.ndarray): a binary mask min_score (float, optional): [description]. Defaults to 0.5. approx (float, optional): it approximate the polygons to reduce the number of points. Defaults to 0.01, that means reduce

the number of points by 10%.
Returns:
[type]: [description]
polimorfo.utils.maskutils.polygons_to_mask(polygons, height, width)[source]

convert polygons to mask. Filter all the polygons with less than 4 points

Args:
polygons ([type]): [description] height ([type]): [description] width ([type]): [description]
Returns:
[type]: a mask of format num_classes, heigth, width
polimorfo.utils.maskutils.area(mask, min_score=0.5)[source]
polimorfo.utils.maskutils.bbox(polygons, height, width)[source]
polimorfo.utils.maskutils.coco_poygons_to_mask(segmentations, height, width) → numpy.ndarray[source]

polimorfo.utils.visualizeutils module

Module contents