Fix issue in polygon_to_mask - expects a np.int32 datatype

This commit is contained in:
LinasKo
2024-10-31 17:18:08 +02:00
parent 37f0ad8b14
commit 6f3491f03c
+1 -2
View File
@@ -25,8 +25,7 @@ def polygon_to_mask(polygon: np.ndarray, resolution_wh: Tuple[int, int]) -> np.n
"""
width, height = map(int, resolution_wh)
mask = np.zeros((height, width), dtype=np.uint8)
cv2.fillPoly(mask, [polygon], color=1)
cv2.fillPoly(mask, [polygon.astype(np.int32)], color=1)
return mask