aws-solutions-library-samples / osml-model-runner

MIT No Attribution
7 stars 1 forks source link

feat: add variable overlap tiling strategy #90

Closed edparris closed 2 months ago

edparris commented 2 months ago

This PR contains an implementation of the VariableOverlapTilingStrategy that has been requested by some users with CV models who need to receive full tiles of real pixels. This new region and tile decomposition strategy has been implemented using the new TilingStrategy abstraction which will allow us to easily enable this behavior with minimal code changes.

Figure 1: An example 25Kx12K image with 4096 tiles, a minimum of 100 pixel overlap and a 10K region size divided into regions using the baseline tiling strategy (VariableTileTilingStrategy). Note that the region size and overlap are fixed at the requested values but that tiles at the edges of each region and the image are truncated. image

Figure 2: The same example image divided into regions using the new VariableOverlapTilingStrategy. Note that the overlap distance and region boundaries have been adjusted to make cutting full 4096x4096 tiles from each region possible. image

Checklist

Before you submit a pull request, please make sure you have the following:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.