Skip to content

Commit

Permalink
fix rescale_image (modelscope#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelikefeet authored Oct 11, 2024
1 parent 9a20a53 commit 4b59676
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swift/llm/utils/vision_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def rescale_image(img: 'PIL.Image.Image', rescale_image: int = -1) -> 'PIL.Image
ratio = width / height
height_scaled = math.pow(rescale_image / ratio, 0.5)
width_scaled = height_scaled * ratio
return T.Resize((int(width_scaled), int(height_scaled)))(img)
return T.Resize((int(height_scaled), int(width_scaled)))(img)


_T = TypeVar('_T')
Expand Down

0 comments on commit 4b59676

Please sign in to comment.