We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 386a91b commit 0a04aaaCopy full SHA for 0a04aaa
torchvision/transforms.py
@@ -33,10 +33,10 @@ def __call__(self, pic):
33
else:
34
# handle PIL Image
35
img = torch.ByteTensor(torch.ByteStorage.from_buffer(pic.tobytes()))
36
- img = img.view(pic.size[0], pic.size[1], 3)
37
- # put it from WHC to CHW format
+ img = img.view(pic.size[1], pic.size[0], 3)
+ # put it from HWC to CHW format
38
# yikes, this transpose takes 80% of the loading time/CPU
39
- img = img.transpose(0, 2).contiguous()
+ img = img.transpose(0, 1).transpose(0, 2).contiguous()
40
return img.float().div(255)
41
42
class ToPILImage(object):
0 commit comments