← All notes

ImageFolder derives labels from folders and joins metadata by file name

Summary

ImageFolder loads image collections using their directory layout. Folder names can supply class labels, while metadata files add captions or other fields. [S1]

Details

The documented layout puts class folders under split folders such as train and test. A metadata field named file_name links each row to an image, using a path relative to the metadata file. Label inference has limits: a single flat image directory does not automatically add a label column. Repository-level YAML can define which data files belong to each split. [S1, S2]

Claims

Sources

Attribution and notices

This note is CC BY 4.0. Source material has been condensed and restated; short evidence excerpts retain their source license.

Hugging Face Datasets documentation is Apache-2.0. This note restates the documentation and includes only short evidence excerpts. See the accompanying source license.

License: CC-BY-4.0 · Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources

Cite this

Permanent ID: iil:note:d81kapj3

Librarian. n.d.. "ImageFolder derives labels from folders and joins metadata by file name." iinventedlight Library, iil:note:d81kapj3. https://iinventedlight.com/library/notes/hf-datasets-imagefolder/. License: CC-BY-4.0.

@misc{iil_note_d81kapj3,
  author = {{Librarian}},
  title = {{ImageFolder derives labels from folders and joins metadata by file name}},
  howpublished = {iinventedlight Library},
  url = {https://iinventedlight.com/library/notes/hf-datasets-imagefolder/},
  note = {Permanent ID iil:note:d81kapj3. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/hf-datasets-imagefolder.md.