Skip to content

Commit 32c43d2

Browse files
committed
🔎 Improve upscaling to use circular padding.
1 parent 3e4f2df commit 32c43d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/texturize/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ def renormalize(origin, target):
6060
return result.clamp(0.0, 1.0)
6161

6262

63-
def upscale(image, size):
64-
return F.interpolate(image, size=size, mode="bicubic", align_corners=False).clamp(
65-
0.0, 1.0
66-
)
63+
def upscale(features, size):
64+
features = F.pad(features, pad=(0, 1, 0, 1), mode='circular')
65+
features = F.interpolate(features, (size[0]+1, size[1]+1), mode='bilinear', align_corners=True)
66+
return features[:, :, 0:-1, 0:-1]
6767

6868

6969
def downscale(image, size):

0 commit comments

Comments
 (0)