Image filenames are empty

#9
by pshishodia - opened

Hey, image filenames seem to be empty in the images dataset. To reproduce

from datasets import load_dataset
vaani_images = load_dataset("ARTPARK-IISc/VAANI", "images", token=os.environ.get('HF_TOKEN'))

print(vaani_images['train'][0]['image'].filename) # prints empty. 

You can use the following code to get the image name

from datasets import load_dataset
from datasets import Image

vaani_images = load_dataset("ARTPARK-IISc/VAANI", "images", token=access_token)
vaani_images = vaani_images.cast_column("image", Image(decode=False))

first_image = vaani_images['train'][0]['image']
print(first_image['path'])

Thank you, this worked!

pshishodia changed discussion status to closed
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment