question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically add filename for image/audio folder

See original GitHub issue

Feature request

When creating a custom audio of image dataset, it would be great to automatically have access to the filename. It should be both: a) Automatically displayed in the viewer b) Automatically added as a column to the dataset when doing load_dataset

In diffusers our test rely quite heavily on images and audio files now and it’s a bit tedious at the moment to download specific images from a datasets repo.

E.g. we have a dataset of images for tests in diffusers: https://huggingface.co/datasets/hf-internal-testing/diffusers-images where it would be extremely nice to have direct access to the filename both visually on the datasets page (@severo ) as well as via the load_datasets function. We currently have some akward functionality to download images by path name: https://github.com/huggingface/diffusers/blob/2fb8fafa4b761f6fc144cf75a6f6f0ea6af3a1c1/src/diffusers/utils/testing_utils.py#L131 It would be much nicer to just go over load_dataset(...)

Motivation

Intuitively the filename is something people understand directly. E.g if you upload a folder of images online, it’s nice if you recognize the image as well as the filename next to it directly and that you’re able to use it right away.

The label on the other hand is less intuitive to understand as you haven’t added it yourself.

Your contribution

Not sure if I have the time to add it myself anytime soon, but it would help us a lot for diffusers.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
patrickvonplatencommented, Oct 26, 2022

Yes I think the relative path as you proposed makes a lot of sense 😃

1reaction
lhoestqcommented, Oct 25, 2022

also I think that the problem here and in general Image/AudioFolder has default configuration which implies automatic label creation if there is not metadata file

Yea I agree it’s often the wrong default. We can also imagine adding the builder’s parameters as YAML in the repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatically include image and sound files in excel ...
I have a column with filenames in my excel file. In the same folder of the excel file, I have image files in...
Read more >
Rename files automatically (for photos, MP3s, videos, pictures ...
Rename files and folders with Rename Expert for Windows 10, 8 and 7. Easy to use, extremly flexible ... Create file names automatically...
Read more >
How to automatically write your image filename into the Title ...
1. In the thumbnail view, select the images in the folder for which you wish to add the filename to the Object Name...
Read more >
Add an image to a file
To add an image to the file, select the file, open the Images tab and press the Add images to the tag button....
Read more >
Advanced Renamer - Free and fast batch rename utility for ...
Add a prefix or suffix to filenames. Copy or move files to other folders. New folder names can be constructed from file tags...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found