padding fix

This commit is contained in:
u 2024-09-08 17:09:21 +08:00
parent 98466e674c
commit 202484e77f

View File

@ -19,7 +19,7 @@ def pad_image(img, scale):
tmp = max(32, int(32 / scale))
ph = ((h - 1) // tmp + 1) * tmp
pw = ((w - 1) // tmp + 1) * tmp
padding = (0, 0, pw - w, ph - h)
padding = (0, pw - w, 0, ph - h)
return F.pad(img, padding)