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