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:
@@ -33,7 +33,7 @@ def fit_mask(mask, W, H):
|
|||||||
out = []
|
out = []
|
||||||
for i in range(b):
|
for i in range(b):
|
||||||
arr = (mask[i].cpu().numpy() * 255.0).clip(0, 255).astype("uint8")
|
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))
|
out.append(torch.from_numpy(np.array(pil, dtype=np.float32) / 255.0))
|
||||||
return torch.stack(out, 0)
|
return torch.stack(out, 0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user