Fix, from_florence_2: polygons must be shaped (-1, 2)

This commit is contained in:
LinasKo
2024-06-20 21:22:15 +03:00
parent bb513f880a
commit 4599548eeb
+1
View File
@@ -143,6 +143,7 @@ def from_florence_2(
masks_list = []
for polygons_of_same_class in result["polygons"]:
for polygon in polygons_of_same_class:
polygon = np.reshape(polygon, (-1, 2))
mask = polygon_to_mask(polygon, resolution_wh)
masks_list.append(mask)
xyxy = polygon_to_xyxy(polygon)