Describe the bug
By default, the standard Image Dataset maps out file_name to image when loading an Image Dataset.
However, if the dataset contains only 1 image, this does not take place
Steps to reproduce the bug
Input
(dataset with one image multimodalart/repro_1_image)
from datasets import load_dataset
dataset = load_dataset("multimodalart/repro_1_image")
dataset
Output:
DatasetDict({
train: Dataset({
features: ['file_name', 'prompt'],
num_rows: 1
})
})
Input
(dataset with 2+ images multimodalart/repro_2_image)
from datasets import load_dataset
dataset = load_dataset("multimodalart/repro_2_image")
dataset
Output:
DatasetDict({
train: Dataset({
features: ['image', 'prompt'],
num_rows: 2
})
})
Expected behavior
Expected to map file_name → image for all dataset sizes, including 1.
Environment info
Both latest main and 2.16.0