← All notes

Prepare semantic segmentation datasets

Short answer

Semantic segmentation pairs each image with a mask that labels every pixel. Apply the same geometric augmentation to image and mask together (Albumentations takes both), and run it on the fly with set_transform(). [S1][S2]

Claims

Sources

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

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Hugging Face (datasets docs), Semantic segmentation · Hugging Face, Apache-2.0 (huggingface/datasets docs); Hugging Face (datasets docs), Process image data · Hugging Face, Apache-2.0 (huggingface/datasets docs).

Cite this

Permanent ID: iil:note:q8r48v87

iinventedlight. 2026. "Prepare semantic segmentation datasets." iinventedlight Library, iil:note:q8r48v87, version of 2026-11-04. https://iinventedlight.com/library/notes/hf-datasets-semantic-segmentation/. License: CC-BY-4.0.

@misc{iil_note_q8r48v87,
  author = {{iinventedlight}},
  title = {{Prepare semantic segmentation datasets}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/hf-datasets-semantic-segmentation/},
  note = {Permanent ID iil:note:q8r48v87. 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-semantic-segmentation.md.