Fix UINT8 overflow for >255 segmentation masks (#16690)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
0b861816c7
commit
4073fa0b87
1 changed files with 1 additions and 1 deletions
|
|
@ -216,7 +216,7 @@ def polygons2masks_overlap(imgsz, segments, downsample_ratio=1):
|
|||
ms = []
|
||||
for si in range(len(segments)):
|
||||
mask = polygon2mask(imgsz, [segments[si].reshape(-1)], downsample_ratio=downsample_ratio, color=1)
|
||||
ms.append(mask)
|
||||
ms.append(mask.astype(masks.dtype))
|
||||
areas.append(mask.sum())
|
||||
areas = np.asarray(areas)
|
||||
index = np.argsort(-areas)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue