Fix RIFE CUDA tensor size mismatch error, implement scale

This commit is contained in:
n00mkrad 2021-12-09 10:50:46 +01:00
parent 290c2c44a0
commit 3bb3cf9596
1 changed files with 4 additions and 7 deletions

View File

@ -167,13 +167,10 @@ def pad_image(img):
else:
return F.pad(img, padding)
if args.UHD:
print("UHD mode enabled.")
ph = ((h - 1) // 64 + 1) * 64
pw = ((w - 1) // 64 + 1) * 64
else:
ph = ((h - 1) // 32 + 1) * 32
pw = ((w - 1) // 32 + 1) * 32
print(f"Using scale {args.scale}.")
tmp = max(128, int(128 / args.scale))
ph = ((h - 1) // tmp + 1) * tmp
pw = ((w - 1) // tmp + 1) * tmp
padding = (0, pw - w, 0, ph - h)
write_buffer = Queue(maxsize=args.rbuffer)