Fix scale_shorter_dimension portrait check (#11862)

This commit is contained in:
nomadoor
2026-01-14 11:25:09 +09:00
committed by GitHub
parent 7eb959ce93
commit c9196f355e

View File

@ -329,7 +329,7 @@ def scale_shorter_dimension(input: torch.Tensor, shorter_size: int, scale_method
if height < width: if height < width:
width = round((width / height) * shorter_size) width = round((width / height) * shorter_size)
height = shorter_size height = shorter_size
elif width > height: elif width < height:
height = round((height / width) * shorter_size) height = round((height / width) * shorter_size)
width = shorter_size width = shorter_size
else: else: