All videos

ENPNOVA Pixel · ·

TorchGeo Data Pipelines Part 2 - Indexing, Sampling, and Speed

This is part 2 of the TorchGeo Data Pipelines series. Reading one sample from a COG is fast. Pipelines get slow when they read thousands of samples from the wrong files, in the wrong order.

Notes

This is part 2 of the TorchGeo Data Pipelines series. Reading one sample from a COG is fast. Pipelines get slow when they read thousands of samples from the wrong files, in the wrong order. This video follows your data from files to batches, and shows how to find the part that’s actually slow.

It starts with the spatial index: what it holds since TorchGeo 0.8, and how a STAC catalog can decide which files TorchGeo ever sees. You’ll also see a filename trap that silently drops remote catalog assets, and how a manifest file avoids it. Next come the three main samplers and how each one reads your storage. That includes how random sampling actually picks a window, why batch sampling is easier on remote data, and how length, region of interest, and time of interest control an epoch. After that, it compares sampling on the fly with pre-cutting chips, and shows how to freeze a training set with proper georeferencing. The last section covers tuning: timing the data loader, where the time goes, GDAL settings for remote COGs, and the DataLoader options that matter.

Code and API details follow TorchGeo 0.9.

Series

Part 1: How TorchGeo reads your data

Part 2: From files to batches (this video)

Part 3: Labels, splits, and normalization

Part 4: Versioning, serving, and inference