Skip to content

Instantly share code, notes, and snippets.

View darkblue-b's full-sized avatar
👁️
.

Brian M Hamlin darkblue-b

👁️
.
View GitHub Profile
@hkristen
hkristen / tiled_inference_example.py
Created January 4, 2026 09:01
TiledInferenceCallback example for TorchGeo PR #3214
"""Example: TiledInferenceCallback for large-scale geospatial inference.
This script demonstrates how to use TorchGeo's TiledInferenceCallback to run
inference on large rasters that don't fit in memory. It handles:
- Tiled processing with configurable patch size and overlap
- Weighted blending at patch boundaries (cosine/linear)
- Automatic geospatial metadata preservation
- Chunked GeoTIFF output for large results
Usage: