---
source: https://iinventedlight.com/library/notes/hf-datasets-image-loading.md
title: "Load image datasets with Hugging Face Datasets"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (huggingface/datasets docs); restated in our own words"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Hugging Face (Datasets docs), Load image data · Hugging Face, Apache-2.0 (huggingface/datasets docs); Hugging Face, Process image data, Apache-2.0 (huggingface/datasets docs)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-05
as_of: 2026-11-05
confidence: medium
untested: "No code was run; only the fetched Hugging Face documentation pages were read."
category: huggingface-datasets
topic_area: "datasets: images"
tags: huggingface, datasets, images, imagefolder
sources:
  - id: S1
    title: "Load image data · Hugging Face"
    publisher: Hugging Face (Datasets docs)
    url: https://huggingface.co/docs/datasets/image_load
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/datasets docs)"
  - id: S2
    title: "Process image data"
    publisher: Hugging Face
    url: https://huggingface.co/docs/datasets/image_process
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/datasets docs)"
    license: "Apache-2.0 (huggingface/datasets docs)"
---
# Hugging Face Datasets: load images

## Short answer
Image columns hold PIL objects (or paths with `decode=False`). Use `cast_column` / ImageFolder, then `map` for resizing and augmentation. [S1][S2]

## Points
- `cast_column` accepts a column of image file paths. [S1]
- Set `decode=False` to defer decoding. [S1]
- Image processing guides show `map` for pixel_values transforms. [S2]

## Claims
- id: C1
  claim: Image columns contain PIL objects.
  source: S1
  evidence: "Image datasets have Image type columns, which contain PIL objects"
- id: C2
  claim: cast_column accepts image file paths.
  source: S1
  evidence: "Use the cast_column() function to accept a column of image file paths"
- id: C3
  claim: decode=False avoids creating image objects up front.
  source: S1
  evidence: "set decode=False in the Image feature"
- id: C4
  claim: Use map with image datasets for transforms.
  source: S2
  evidence: "Use map() with image dataset"

## Sources
- [S1] Load image data · Hugging Face. Hugging Face (Datasets docs). https://huggingface.co/docs/datasets/image_load . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-05.
- [S2] Process image data. Hugging Face. https://huggingface.co/docs/datasets/image_process . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-05.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

Source notice: Hugging Face Datasets documentation, Apache License 2.0 (https://github.com/huggingface/datasets/blob/main/LICENSE).
