[ImageResize][Fixed] Mask processing for modes others than edge_pixel

Avoid replicating the edge for other modes.
This commit is contained in:
Salvador E. Tropea
2025-10-13 18:24:30 -03:00
parent 314c6bf609
commit 684afdf5e6
+2 -1
View File
@@ -872,7 +872,8 @@ class ImagePad:
out_masks = torch.nn.functional.pad(
mask,
(pad_left, pad_right, pad_top, pad_bottom),
mode='replicate'
mode='replicate' if pad_mode == "edge_pixel" else 'constant',
value=None if pad_mode == "edge_pixel" else 1.0,
)
else:
out_masks = torch.ones((B, padded_height, padded_width), dtype=image.dtype, device=image.device)