fix: drop deprecated Pillow mode= arg in fit_mask

uint8 2D arrays infer "L" automatically; silences Pillow 13 deprecation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 22:52:45 +02:00
parent 7f90b6878f
commit 969463a4e9
+1 -1
View File
@@ -33,7 +33,7 @@ def fit_mask(mask, W, H):
out = []
for i in range(b):
arr = (mask[i].cpu().numpy() * 255.0).clip(0, 255).astype("uint8")
pil = _resize_crop_pil(Image.fromarray(arr, mode="L"), new_w, new_h, left, top, W, H)
pil = _resize_crop_pil(Image.fromarray(arr), new_w, new_h, left, top, W, H)
out.append(torch.from_numpy(np.array(pil, dtype=np.float32) / 255.0))
return torch.stack(out, 0)