Correct height, width variables

This commit is contained in:
missionfloyd 2023-04-12 21:25:40 -06:00 committed by GitHub
parent f5474109a4
commit 46a57e286d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,8 +320,8 @@ class Rotate:
color = fill_color.replace(" ", "")
color = parse_palette(color)
rotated_image = pil_image.rotate(angle=angle, resample=resamplers[resample], expand=expand, center=center, translate=translate, fillcolor=color)
height, width = rotated_image.size
result = torch.zeros(batch_size, width, height, 3)
width, height = rotated_image.size
result = torch.zeros(batch_size, height, width, 3)
rotated_array = torch.tensor(np.array(rotated_image.convert("RGB"))).float() / 255
result[0] = rotated_array