Skip to content

Conversation

@hkristen
Copy link
Contributor

@hkristen hkristen commented Dec 17, 2025

This is the draft PR based on the discussions in #3099. It works on a small test area right now (7500x7500px, RGB)

This might seem a bit bigger than it is as I re-based on the latest main as well - the new stuff is in:

  • torchgeo/callbacks/tiled_inference.py +196
  • torchgeo/inference/blending.py +427
  • torchgeo/inference/writer.py +142

The rest is

ToDos:

  • Run it on larger areas to see if it breaks and check performance
  • Get rid of uncovered pixels on edges when delta > 0 (See line 291 in torchgeo/inference/blending.py)
  • Add more tests to reach 100% coverage
  • Add integration tests that can be run locally on a semi-large scene e.g. ~8 x 4096px chunks

@hkristen hkristen marked this pull request as draft December 17, 2025 14:56
@github-actions github-actions bot added datasets Geospatial or benchmark datasets testing Continuous integration testing samplers Samplers for indexing datasets trainers PyTorch Lightning trainers datamodules PyTorch Lightning datamodules labels Dec 17, 2025
@hkristen hkristen changed the title Tiled inference callback Tiled inference callback for Semantic Segmentation Dec 17, 2025
@hkristen hkristen changed the title Tiled inference callback for Semantic Segmentation [Semantic Segmentation] Tiled inference callback Dec 17, 2025
@hkristen hkristen closed this Dec 18, 2025
@hkristen hkristen reopened this Dec 18, 2025
@hkristen
Copy link
Contributor Author

I tested the tiled inference on a larger scene 46317x40717, discovered a memory overflow and fixed it. Besides that and that mypy is bugging me, stuff is working as it should.
@adamjstewart feel free to add you thoughts on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datamodules PyTorch Lightning datamodules datasets Geospatial or benchmark datasets samplers Samplers for indexing datasets testing Continuous integration testing trainers PyTorch Lightning trainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant