Differing image shapes when loaded

#8
by bgercek - opened

I really appreciate the effort you've gone through to upload this dataset. However I run into the issue when loading the data that the original and augmented image tensors do not match in shape:

from datasets import load_dataset

ds = load_dataset("logasja/mit-adobe-fivek", "a").with_format("torch")
print(ds["train"][0]["original"].shape)
print(ds["train"][0]["augmented"].shape)

Results in shapes of:

torch.Size([2920, 4386, 3])
torch.Size([2912, 4368, 3])

for the two images.

In some cases this is the result of a cropping of the image, while in others the image is rotated in the original and in the correct orientation in the augmented version.

Do you know why this is the case, and is there an easy way to fix the problem?

Good catch! I am currently in the midst of working through my dissertation work but I assume that the difference has to do with how ImageMagick's "mogrify" command converted the images. I won't have much time to address this for the next few months but I'm happy to review any pull request!

Thanks!

Sign up or log in to comment