The images of `EMNIST()` are flipped and rotated 90 degrees anticlockwise by default

Open
#8,783 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, pytorch

Research direction

Start by running the EMNIST() reproduction in the issue with torchvision 0.20.1 and inspect the EMNIST dataset entry point. The work is done when displayed training and test images are no longer flipped or rotated 90 degrees anticlockwise by default.

Written by the indexing model from the issue text.

Description

🐛 Describe the bug

The images of EMNIST() are flipped and rotated 90 degrees anticlockwise by default as shown below:

from torchvision.datasets import EMNIST

train_data = EMNIST(
    root="data",
    split="byclass",
    train=True,
    download=True,
)

test_data = EMNIST(
    root="data",
    split="byclass",
    train=False,
    download=True
)

import matplotlib.pyplot as plt

def show_images(data):
    plt.figure(figsize=(10, 5))
    col = 5
    for i, (image, label) in enumerate(data, 1):
        plt.subplot(1, col, i)
        plt.title(label)
        plt.axis('off')
        plt.imshow(image)
        if i == col:
            break
    plt.show()

show_images(data=train_data)
show_images(data=test_data)

Screenshot 2024-12-05 091144

Versions
import torchvision

torchvision.__version__ # '0.20.1'
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pytorch/vision

All issues in pytorch/vision

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.